A regular polygon with $n$ sides is inscribed in a circle with radius $R$. The area of the polygon is $3R^2$. Determine the value of $n$.

Let's think step by step and output the final answer within \boxed{}.
user