From the condition, we have these two equations m + n = 9, (counting the sides)+ = 7 (counting the diagonals). Equivalently m + n = 9, + = 14. Equivalently m + n = 9, + = 14. Equivalently m + n = 9, + = 14 + 3*(m+n) = 14 + 3*9 = 14 +27 = 41. Thus you have these two equations m + n = 9, (1) m^2 + n^2 = 41. (2) From (1), express m = 9-n and substitute it into (2). You will get a quadratic equation. Solve it by any way you want. Answer. 4 sides and 5 sides.