count the length of string