import java.util.Scanner;

public class Main{
	public static void main(String args[]){
      Scanner scan = new Scanner(System.in);
      String s = scan.next();

      int count = 0;
      if(s.charAt(1) == 'S'){
        if(s.charAt(0) == 'R' || s.charAt(2) == 'R')
            count = 1;
        else
            count = 0;
      }else{
          if(s.charAt(0) == 'R'){
            if(s.charAt(2) == 'R'){
                count = 3;
            }else{
                count = 2;
            }
          }else if(s.charAt(2) == 'R'){
            if(s.charAt(0) == 'R'){
                count = 3;
            }else{
                count = 2;
            }
          }else
            count = 1;
        }
        System.out.println(count);
    }
} import java.util.Scanner; Scanner java.util public class Main{
	public static void main(String args[]){
      Scanner scan = new Scanner(System.in);
      String s = scan.next();

      int count = 0;
      if(s.charAt(1) == 'S'){
        if(s.charAt(0) == 'R' || s.charAt(2) == 'R')
            count = 1;
        else
            count = 0;
      }else{
          if(s.charAt(0) == 'R'){
            if(s.charAt(2) == 'R'){
                count = 3;
            }else{
                count = 2;
            }
          }else if(s.charAt(2) == 'R'){
            if(s.charAt(0) == 'R'){
                count = 3;
            }else{
                count = 2;
            }
          }else
            count = 1;
        }
        System.out.println(count);
    }
} Main public static void main(String args[]){
      Scanner scan = new Scanner(System.in);
      String s = scan.next();

      int count = 0;
      if(s.charAt(1) == 'S'){
        if(s.charAt(0) == 'R' || s.charAt(2) == 'R')
            count = 1;
        else
            count = 0;
      }else{
          if(s.charAt(0) == 'R'){
            if(s.charAt(2) == 'R'){
                count = 3;
            }else{
                count = 2;
            }
          }else if(s.charAt(2) == 'R'){
            if(s.charAt(0) == 'R'){
                count = 3;
            }else{
                count = 2;
            }
          }else
            count = 1;
        }
        System.out.println(count);
    } main {
      Scanner scan = new Scanner(System.in);
      String s = scan.next();

      int count = 0;
      if(s.charAt(1) == 'S'){
        if(s.charAt(0) == 'R' || s.charAt(2) == 'R')
            count = 1;
        else
            count = 0;
      }else{
          if(s.charAt(0) == 'R'){
            if(s.charAt(2) == 'R'){
                count = 3;
            }else{
                count = 2;
            }
          }else if(s.charAt(2) == 'R'){
            if(s.charAt(0) == 'R'){
                count = 3;
            }else{
                count = 2;
            }
          }else
            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 int count = 0; count 0 if(s.charAt(1) == 'S'){
        if(s.charAt(0) == 'R' || s.charAt(2) == 'R')
            count = 1;
        else
            count = 0;
      }else{
          if(s.charAt(0) == 'R'){
            if(s.charAt(2) == 'R'){
                count = 3;
            }else{
                count = 2;
            }
          }else if(s.charAt(2) == 'R'){
            if(s.charAt(0) == 'R'){
                count = 3;
            }else{
                count = 2;
            }
          }else
            count = 1;
        } s.charAt(1) == 'S' s.charAt(1) s.charAt s 1 'S' {
        if(s.charAt(0) == 'R' || s.charAt(2) == 'R')
            count = 1;
        else
            count = 0;
      } if(s.charAt(0) == 'R' || s.charAt(2) == 'R')
            count = 1;
        else
            count = 0; s.charAt(0) == 'R' || s.charAt(2) == 'R' s.charAt(0) == 'R' s.charAt(0) s.charAt s 0 'R' s.charAt(2) == 'R' s.charAt(2) s.charAt s 2 'R' count = 1 count 1 count = 0 count 0 {
          if(s.charAt(0) == 'R'){
            if(s.charAt(2) == 'R'){
                count = 3;
            }else{
                count = 2;
            }
          }else if(s.charAt(2) == 'R'){
            if(s.charAt(0) == 'R'){
                count = 3;
            }else{
                count = 2;
            }
          }else
            count = 1;
        } if(s.charAt(0) == 'R'){
            if(s.charAt(2) == 'R'){
                count = 3;
            }else{
                count = 2;
            }
          }else if(s.charAt(2) == 'R'){
            if(s.charAt(0) == 'R'){
                count = 3;
            }else{
                count = 2;
            }
          }else
            count = 1; s.charAt(0) == 'R' s.charAt(0) s.charAt s 0 'R' {
            if(s.charAt(2) == 'R'){
                count = 3;
            }else{
                count = 2;
            }
          } if(s.charAt(2) == 'R'){
                count = 3;
            }else{
                count = 2;
            } s.charAt(2) == 'R' s.charAt(2) s.charAt s 2 'R' {
                count = 3;
            } count = 3 count 3 {
                count = 2;
            } count = 2 count 2 if(s.charAt(2) == 'R'){
            if(s.charAt(0) == 'R'){
                count = 3;
            }else{
                count = 2;
            }
          }else
            count = 1; s.charAt(2) == 'R' s.charAt(2) s.charAt s 2 'R' {
            if(s.charAt(0) == 'R'){
                count = 3;
            }else{
                count = 2;
            }
          } if(s.charAt(0) == 'R'){
                count = 3;
            }else{
                count = 2;
            } s.charAt(0) == 'R' s.charAt(0) s.charAt s 0 'R' {
                count = 3;
            } count = 3 count 3 {
                count = 2;
            } count = 2 count 2 count = 1 count 1 System.out.println(count) System.out.println System.out System System.out count String args[] args public class Main{
	public static void main(String args[]){
      Scanner scan = new Scanner(System.in);
      String s = scan.next();

      int count = 0;
      if(s.charAt(1) == 'S'){
        if(s.charAt(0) == 'R' || s.charAt(2) == 'R')
            count = 1;
        else
            count = 0;
      }else{
          if(s.charAt(0) == 'R'){
            if(s.charAt(2) == 'R'){
                count = 3;
            }else{
                count = 2;
            }
          }else if(s.charAt(2) == 'R'){
            if(s.charAt(0) == 'R'){
                count = 3;
            }else{
                count = 2;
            }
          }else
            count = 1;
        }
        System.out.println(count);
    }
} public class Main{
	public static void main(String args[]){
      Scanner scan = new Scanner(System.in);
      String s = scan.next();

      int count = 0;
      if(s.charAt(1) == 'S'){
        if(s.charAt(0) == 'R' || s.charAt(2) == 'R')
            count = 1;
        else
            count = 0;
      }else{
          if(s.charAt(0) == 'R'){
            if(s.charAt(2) == 'R'){
                count = 3;
            }else{
                count = 2;
            }
          }else if(s.charAt(2) == 'R'){
            if(s.charAt(0) == 'R'){
                count = 3;
            }else{
                count = 2;
            }
          }else
            count = 1;
        }
        System.out.println(count);
    }
} Main
import java.util.Scanner;

public class Main{
	public static void main(String args[]){
      Scanner scan = new Scanner(System.in);
      String s = scan.next();

      int count = 0;
      if(s.charAt(1) == 'S'){
        if(s.charAt(0) == 'R' || s.charAt(2) == 'R')
            count = 1;
        else
            count = 0;
      }else{
          if(s.charAt(0) == 'R'){
            if(s.charAt(2) == 'R'){
                count = 3;
            }else{
                count = 2;
            }
          }else if(s.charAt(2) == 'R'){
            if(s.charAt(0) == 'R'){
                count = 3;
            }else{
                count = 2;
            }
          }else
            count = 1;
        }
        System.out.println(count);
    }
}