You need to say that (a) there are at least $n$ objectselements, and (b) there are at most $n$ objectselements. To express (a), $$ L_n := \exists x_1\dotsc \exists x_n\, \bigwedge_{1\le i < j \le n} x_i\ne x_j. $$$$ L_n := \exists x_1\dotsc \exists x_n\, \left( \bigwedge_{1\le i < j \le n} x_i\ne x_j \right). $$ To express (b), $$ M_n := \forall x_1\dotsc \forall x_{n+1}\, \bigvee_{1\le i < j \le n+1}x_i = x_j. $$$$ M_n := \forall x_1\dotsc \forall x_{n+1}\, \left( \bigvee_{1\le i < j \le n+1}x_i = x_j\right). $$ So the sentence $L_n \land M_n$ holds iff there are exactly $n$ elements.