Hi, I'm not sure how to go about finding the solution to this question.

Let R be a ring with identity such that x^{2}= 1_{R}for all 0_{R }=/= x in R. How many elements are in R?

I've just been playing around with squaring elements, like (x+1_{R})^{2}= x^{2}+2.x+1_{R}=2.x+2.1_{R}= 1_{R. }But I'm not sure where to go with this. Any help?