A set $S$ of distinct positive integers has the following property: for every integer $x$ in $S$, the arithmetic mean of the set of values obtained by deleting $x$ from $S$ is an integer. Given that $1$ belongs to $S$ and that $2002$ is the largest element of $S$, what is the greatest number of elements that $S$ can have?