naive word counting version