LearnPy Hub
← Arena
EasyRating 800

Longest Heads Streak

A coin was tossed many times. Print the length of the longest run of H in a row (0 if there is none).

Input

A string of H and T.

Output

One integer.

Sample 1

Input
HHTHHHT
Output
3

Sample 2

Input
TTTT
Output
0
solution.py
Output appears here
Longest Heads Streak · Python Arena problem · LearnPy Hub