A polygon has 2 pairs of complementary interior angles and three sets of supplementary interior angles. The sum of the remaining interior angles is 1440. How many sides does the polygon have? Explain.