How did Einstein calculate the mass energy equation E = MC2?

How did Einstein calculate the mass energy equation E = MC2?

E=W=FS=mavt=mvv=mcc.
(F=ma:S=vt:V=at:V(max)=c)