Consider a regular polygon with n sides. If it is known that the measure of each interior angle is $$x$$ degrees, we can derive the number of sides using the formula:
$$x =\frac{(n-2) imes 180}{n}$$
It is given that the measure of each interior angle is $$140$$ degrees. Calculate the number of sides of the polygon.