import java.util.Scanner;
import java.util.List;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.Arrays;
import java.util.Collections;
import java.util.*;
import java.math.BigInteger;
class Main{
  public static void main(String[] args){
    Scanner scan = new Scanner(System.in);
    String S = scan.next();
    String[] split = S.split("");
    int count = 0;
    for (int i = 0;i < 3;i++) {
      if (split[i].equals("R")) {
        count += 1;
      }
    }
    if (S.equals("RSR")) {
      count -= 1;
    }
    System.out.println(count);
  }
}
 import java.util.Scanner; Scanner java.util import java.util.List; List java.util import java.util.ArrayList; ArrayList java.util import java.util.Comparator; Comparator java.util import java.util.Arrays; Arrays java.util import java.util.Collections; Collections java.util import java.util.*; util.* java import java.math.BigInteger; BigInteger java.math class Main{
  public static void main(String[] args){
    Scanner scan = new Scanner(System.in);
    String S = scan.next();
    String[] split = S.split("");
    int count = 0;
    for (int i = 0;i < 3;i++) {
      if (split[i].equals("R")) {
        count += 1;
      }
    }
    if (S.equals("RSR")) {
      count -= 1;
    }
    System.out.println(count);
  }
} Main public static void main(String[] args){
    Scanner scan = new Scanner(System.in);
    String S = scan.next();
    String[] split = S.split("");
    int count = 0;
    for (int i = 0;i < 3;i++) {
      if (split[i].equals("R")) {
        count += 1;
      }
    }
    if (S.equals("RSR")) {
      count -= 1;
    }
    System.out.println(count);
  } main {
    Scanner scan = new Scanner(System.in);
    String S = scan.next();
    String[] split = S.split("");
    int count = 0;
    for (int i = 0;i < 3;i++) {
      if (split[i].equals("R")) {
        count += 1;
      }
    }
    if (S.equals("RSR")) {
      count -= 1;
    }
    System.out.println(count);
  } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) String S = scan.next(); S scan.next() scan.next scan String[] split = S.split(""); split S.split("") S.split S "" int count = 0; count 0 for (int i = 0;i < 3;i++) {
      if (split[i].equals("R")) {
        count += 1;
      }
    } int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
      if (split[i].equals("R")) {
        count += 1;
      }
    } {
      if (split[i].equals("R")) {
        count += 1;
      }
    } if (split[i].equals("R")) {
        count += 1;
      } split[i].equals("R") split[i].equals split[i] split i "R" {
        count += 1;
      } count += 1 count 1 if (S.equals("RSR")) {
      count -= 1;
    } S.equals("RSR") S.equals S "RSR" {
      count -= 1;
    } count -= 1 count 1 System.out.println(count) System.out.println System.out System System.out count String[] args args
import java.util.Scanner;
import java.util.List;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.Arrays;
import java.util.Collections;
import java.util.*;
import java.math.BigInteger;
class Main{
  public static void main(String[] args){
    Scanner scan = new Scanner(System.in);
    String S = scan.next();
    String[] split = S.split("");
    int count = 0;
    for (int i = 0;i < 3;i++) {
      if (split[i].equals("R")) {
        count += 1;
      }
    }
    if (S.equals("RSR")) {
      count -= 1;
    }
    System.out.println(count);
  }
}

