get the length of a vector