Find a 1-dimensional sufficient statistic for theta. $X_1, X_2,\ldots,X_n$ is a sample from random variable $X$.
$$f(x\mid\theta)=\frac 1 {\sqrt{2\pi}}\exp{(-\frac{1}{2}(x-\theta)^2)}$$
I have to find a 1-dimensional sufficient statistic for $\theta$ and I'm not sure how to go about doing this. Any help would be appreciated.
I've got that the log-likelihood function is 
$$\ell(\theta)=\sum^n_{i=1}(-\frac{1}{2}(x-\theta)^2)$$

Use the factorization theorem. 
Hint #$1$:
$$
\sum(x_i - \theta)^2 =\sum x_i^2-2\theta n\bar{x}_n+n\theta^2,
$$
Hint #$2$: 
The MLE is always a function of the MSS. What is the MLE of $\theta$?
