object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val s = sc.next

  if (s.contains("SSS")) {
    println("3")
  } else if (s.contains("SS")) {
    println("2")
  } else if (s.contains("S")) {
    println("1")
  } else {
    println("0")
  }
}