PLU Count

No attempts yetTime limit1sMemory limit128 MB

Problem

Given a text string, find the maximum number of non-interleaved occurrences of PLU in it. In each occurrence the letters P, L, U must appear in that order; capitalization does not matter and the letters need not be consecutive. However, one occurrence must be completed (P, then L, then U) before the next one may begin. Equivalently, find the largest $k$ such that the string PLU repeated $k$ times (PLUPLU…) is a subsequence of the text. For example, the string pppxLLLxuuu has just one non-interleaved occurrence of PLU.

Input

The first line is a positive integer $n$, the number of text strings that follow. Each of the next $n$ lines contains one text string. Each string is at most 80 characters long, and there are no blank lines.

Output

For each text string, print on its own line the maximum number of non-interleaved occurrences of PLU, as described above.