def read():
    return int(input())

def reads(sep=None):
    return list(map(int, input().split(sep)))

def main():
    x = input()[::-1]
    i = 0
    while x[i] == 'S':
        i += 1
    print(i*2)

main()
