The general formula for the sum of interior angles of an n-gon is 180*(n-2) degrees. In your case it is 180*(31-2) = 180*29 = 5220 degrees.