using System;
using System.Linq;
using System.Collections.Generic;
using System.Text.RegularExpressions;
namespace Solution
{
    class Solution
    {
        static void Main(string[] args)
        {
            string s = System.Console.ReadLine();
            int n = s.Length - 1;
            int count = 0;
            while (s[n] == 'S')
            {
                count++;
                n--;
            }
            System.Console.WriteLine(count * 2);
        }

    }
}
