count each word inside a string