시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 128 MB83634985.965%

문제

Given a text string you must find the number of non-interleaved occurrences of PLU in the string. The letters P, L, U must occur in order, but capitalization is not important and the letters need not be consecutive. For example the string “pppxLLLxuuu” has just one non-interleaved occurrence of PLU.

입력

The first line of input will be a positive integer, n, indicating the number of text strings that follow. Following the positive integer will be n text strings, one per line. Each text string will be at most 80 characters and there will be no blank lines.

출력

For each text string print the maximum number of non-interleaved occurrences of PLU as described above.

예제 입력 1

3
Please find the number of parts listed under automotive.
The building was constructed for the public.
pppxLLLxuuu

예제 출력 1

2
0
1