This page is still under construction.

Parts of this page are still being built. What you see may change.

Angry Grammar Stickler

Time limit1sMemory limit256 MB

Summary
The program counts banned words and phrases in each sentence and prints ten times that count.
Level

Easy1 of 10

Topics
String, Implementation
Solved
No attempts yet

Problem

Your friend spends his days correcting other people's English on internet forums. He has a short temper, and badly written sentences set him off. To stop him from breaking another keyboard, you told him to put the page down and count out loud from 1 to 10 every time he gets angry. Each fit of anger therefore costs him exactly ten spoken numbers.

He gets angry at the following.

  • The word u or the word ur, written instead of you or your.
  • The two words would of or should of in a row, written instead of would have or should have.
  • Any word that contains lol as a substring, written instead of haha.

Each word is judged on its own. A word that contains lol more than once still angers him only once. The two-word rule applies once for every position where would or should is immediately followed by of.

Write a program that reads sentences one by one and reports, for each sentence, how many numbers your friend speaks while reading it.

Input

The first line contains the number of sentences TT. Each of the next TT lines contains one sentence, made of one or more words separated by single spaces.

  • 0<T≤500 < T \le 50
  • A sentence is at most 100 characters long, spaces included.
  • A word consists only of lowercase letters from a to z.
  • Two adjacent words are separated by exactly one space, and a sentence has no leading or trailing space.

Output

For each sentence, print on its own line how many numbers your friend speaks while reading it. That value is ten times the number of fits of anger.

Examples3

  1. Example 1

    Input
    4
    u haz lolcats
    my car is green
    i have a lollipop
    u should of lold
    
    Expected output
    20
    0
    10
    30
    
  2. Example 2

    Input
    1
    u
    
    Expected output
    10
    
  3. Example 3

    Input
    1
    you your have haha of would should
    
    Expected output
    0