import java.util.Scanner;

public class Main{

    public static void main(String[] args) {
        Scanner std = new Scanner(System.in);
        String str = std.next();
        int count = 0;
        for(int i = 0; i < str.length(); i++) {
            if(count == 0 && 'R' == (char)str.charAt(i))
                count++;
            if(i > 0 && str.charAt(i - 1) == str.charAt(i) && 'R' == (char)str.charAt(i))
                count++;
        }

        System.out.println(count);
    }

} import java.util.Scanner; Scanner java.util public class Main{

    public static void main(String[] args) {
        Scanner std = new Scanner(System.in);
        String str = std.next();
        int count = 0;
        for(int i = 0; i < str.length(); i++) {
            if(count == 0 && 'R' == (char)str.charAt(i))
                count++;
            if(i > 0 && str.charAt(i - 1) == str.charAt(i) && 'R' == (char)str.charAt(i))
                count++;
        }

        System.out.println(count);
    }

} Main public static void main(String[] args) {
        Scanner std = new Scanner(System.in);
        String str = std.next();
        int count = 0;
        for(int i = 0; i < str.length(); i++) {
            if(count == 0 && 'R' == (char)str.charAt(i))
                count++;
            if(i > 0 && str.charAt(i - 1) == str.charAt(i) && 'R' == (char)str.charAt(i))
                count++;
        }

        System.out.println(count);
    } main {
        Scanner std = new Scanner(System.in);
        String str = std.next();
        int count = 0;
        for(int i = 0; i < str.length(); i++) {
            if(count == 0 && 'R' == (char)str.charAt(i))
                count++;
            if(i > 0 && str.charAt(i - 1) == str.charAt(i) && 'R' == (char)str.charAt(i))
                count++;
        }

        System.out.println(count);
    } Scanner std = new Scanner(System.in); std new Scanner(System.in) String str = std.next(); str std.next() std.next std int count = 0; count 0 for(int i = 0; i < str.length(); i++) {
            if(count == 0 && 'R' == (char)str.charAt(i))
                count++;
            if(i > 0 && str.charAt(i - 1) == str.charAt(i) && 'R' == (char)str.charAt(i))
                count++;
        } int i = 0; int i = 0; i 0 i < str.length() i str.length() str.length str i++ i++ i {
            if(count == 0 && 'R' == (char)str.charAt(i))
                count++;
            if(i > 0 && str.charAt(i - 1) == str.charAt(i) && 'R' == (char)str.charAt(i))
                count++;
        } {
            if(count == 0 && 'R' == (char)str.charAt(i))
                count++;
            if(i > 0 && str.charAt(i - 1) == str.charAt(i) && 'R' == (char)str.charAt(i))
                count++;
        } if(count == 0 && 'R' == (char)str.charAt(i))
                count++; count == 0 && 'R' == (char)str.charAt(i) count == 0 count 0 'R' == (char)str.charAt(i) 'R' (char)str.charAt(i) str.charAt str i count++ count if(i > 0 && str.charAt(i - 1) == str.charAt(i) && 'R' == (char)str.charAt(i))
                count++; i > 0 && str.charAt(i - 1) == str.charAt(i) && 'R' == (char)str.charAt(i) i > 0 && str.charAt(i - 1) == str.charAt(i) && 'R' == (char)str.charAt(i) i > 0 i 0 str.charAt(i - 1) == str.charAt(i) str.charAt(i - 1) str.charAt str i - 1 i 1 str.charAt(i) str.charAt str i 'R' == (char)str.charAt(i) 'R' (char)str.charAt(i) str.charAt str i count++ count 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 std = new Scanner(System.in);
        String str = std.next();
        int count = 0;
        for(int i = 0; i < str.length(); i++) {
            if(count == 0 && 'R' == (char)str.charAt(i))
                count++;
            if(i > 0 && str.charAt(i - 1) == str.charAt(i) && 'R' == (char)str.charAt(i))
                count++;
        }

        System.out.println(count);
    }

} public class Main{

    public static void main(String[] args) {
        Scanner std = new Scanner(System.in);
        String str = std.next();
        int count = 0;
        for(int i = 0; i < str.length(); i++) {
            if(count == 0 && 'R' == (char)str.charAt(i))
                count++;
            if(i > 0 && str.charAt(i - 1) == str.charAt(i) && 'R' == (char)str.charAt(i))
                count++;
        }

        System.out.println(count);
    }

} Main
import java.util.Scanner;

public class Main{

    public static void main(String[] args) {
        Scanner std = new Scanner(System.in);
        String str = std.next();
        int count = 0;
        for(int i = 0; i < str.length(); i++) {
            if(count == 0 && 'R' == (char)str.charAt(i))
                count++;
            if(i > 0 && str.charAt(i - 1) == str.charAt(i) && 'R' == (char)str.charAt(i))
                count++;
        }

        System.out.println(count);
    }

}