Please clarify what you mean by "equation for counting angles." Are you referring to a formula for the sum of angles in a polygon? For example the sum of interior angles for a triangle is always 180 degrees, and for a rectangle or other 4-sided polygon the sum is 360. If that's what you mean: the sum of interior angles for an N-sided polygon is 180N-360.
If that is what you are asking about, one way to see that is true is this: take any point on the inside of the polygon and draw lines from that point to each vertex. That divides the polygon into n triangles. Each triangle has total angle measure 180 degrees so those n triangles have angles adding to 180n degrees. But one angle in each triangle is at that center point and since those angles go all the way around, they add to 360 degrees. So the sum of all the angles at the vertices is, as ebaines said, 180n- 360.
A related formula is that if we have a regular polygon all n angles have the same measure so each angle has measure .