calculate length of sentences array