#K37362. Max Consecutive High Sales Days

    ID: 25960 Type: Default 1000ms 256MiB

Max Consecutive High Sales Days

Max Consecutive High Sales Days

You are given a string S consisting of characters 'H' and 'L', where 'H' indicates a high sales day and 'L' indicates a low sales day. Your task is to compute the maximum number of consecutive high sales days.

For example, if S = "HHLLH", then the maximum consecutive high sales days is 2. In mathematical terms, if we define f(S) as:

$$f(S) = \max\{ \ell \mid \exists i,\; S[i..i+\ell-1] = \underbrace{H \cdots H}_{\ell \text{ times}} \} $$

you need to compute f(S).

inputFormat

The input consists of a single line containing a string S composed only of the characters 'H' and 'L'.

Constraints:

  • 1 \leq |S| \leq 10^5, where |S| denotes the length of the string.

outputFormat

Output a single integer representing the maximum number of consecutive 'H' characters in S.

## sample
HHLLH
2