eolymp
Competitions

1/8 ICPC Azerbaijan Qualification Preparation

TF Problem

An n-character string consisting of a block of T characters followed by a block of F characters. Find the index of the last T or print -1 if one dosen't exists. Indexation in the string starts from 0.

Input

One line of characters of length no more than 106 characters.

Output

Print the index of the last T character. Or print -1 if T character dosen't exists.

Time limit 1 second
Memory limit 128 MiB
Input example #1
TTTTFF
Output example #1
3
Input example #2
FFFFFF
Output example #2
-1
Author Michael Medvediev