Let S be a subset of {1,2,3,...,1000} so that, if a and b are any (not necessarily distinct) elements of S, then their product, ab, is not an element of S. What is the maximum number of elements of S?