Remove elements and return length.