How do you find the total number of σ and π

bonds in a molecule? Is there an equation?

There may be an equation but if there is one I don't know it. I've always just counted them.