Returns the number of elements in the sequence S. For linear sequences, this operation traverses all elements.