chomp($line = <>);
$left = substr($line, 0, rindex($line, 'T') + 1);
$right = substr($line, rindex($line, 'T') + 1, length($line));
$t = ($left =~ tr/S//);
printf (length($left) - ($t * 2) + length($right)) . "\n";
