import java.util.*;
// warm-up
public class Main {

	static void solve() {
		Scanner sc = new Scanner(System.in);
		int n=0;
		char p='.';
		for (char ch : sc.next().toCharArray()) {
			n=((p=='.'||p=='S') && ch=='R') ? 1 : n;
			if (ch=='R' && p=='R') n++;
			p=ch;
		}
		System.out.println(n);
		sc.close();	
	}

	public static void main(String args[]) {
		solve();
	}

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

	static void solve() {
		Scanner sc = new Scanner(System.in);
		int n=0;
		char p='.';
		for (char ch : sc.next().toCharArray()) {
			n=((p=='.'||p=='S') && ch=='R') ? 1 : n;
			if (ch=='R' && p=='R') n++;
			p=ch;
		}
		System.out.println(n);
		sc.close();	
	}

	public static void main(String args[]) {
		solve();
	}

} Main static void solve() {
		Scanner sc = new Scanner(System.in);
		int n=0;
		char p='.';
		for (char ch : sc.next().toCharArray()) {
			n=((p=='.'||p=='S') && ch=='R') ? 1 : n;
			if (ch=='R' && p=='R') n++;
			p=ch;
		}
		System.out.println(n);
		sc.close();	
	} solve {
		Scanner sc = new Scanner(System.in);
		int n=0;
		char p='.';
		for (char ch : sc.next().toCharArray()) {
			n=((p=='.'||p=='S') && ch=='R') ? 1 : n;
			if (ch=='R' && p=='R') n++;
			p=ch;
		}
		System.out.println(n);
		sc.close();	
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n=0; n 0 char p='.'; p '.' for (char ch : sc.next().toCharArray()) {
			n=((p=='.'||p=='S') && ch=='R') ? 1 : n;
			if (ch=='R' && p=='R') n++;
			p=ch;
		} char ch sc.next().toCharArray() sc.next().toCharArray sc.next() sc.next sc {
			n=((p=='.'||p=='S') && ch=='R') ? 1 : n;
			if (ch=='R' && p=='R') n++;
			p=ch;
		} {
			n=((p=='.'||p=='S') && ch=='R') ? 1 : n;
			if (ch=='R' && p=='R') n++;
			p=ch;
		} n=((p=='.'||p=='S') && ch=='R') ? 1 : n n ((p=='.'||p=='S') && ch=='R') ? 1 : n ((p=='.'||p=='S') && ch=='R') (p=='.'||p=='S') p=='.' p '.' p=='S' p 'S' ch=='R' ch 'R' 1 n if (ch=='R' && p=='R') n++; ch=='R' && p=='R' ch=='R' ch 'R' p=='R' p 'R' n++ n p=ch p ch System.out.println(n) System.out.println System.out System System.out n sc.close() sc.close sc public static void main(String args[]) {
		solve();
	} main {
		solve();
	} solve() solve String args[] args public class Main {

	static void solve() {
		Scanner sc = new Scanner(System.in);
		int n=0;
		char p='.';
		for (char ch : sc.next().toCharArray()) {
			n=((p=='.'||p=='S') && ch=='R') ? 1 : n;
			if (ch=='R' && p=='R') n++;
			p=ch;
		}
		System.out.println(n);
		sc.close();	
	}

	public static void main(String args[]) {
		solve();
	}

} public class Main {

	static void solve() {
		Scanner sc = new Scanner(System.in);
		int n=0;
		char p='.';
		for (char ch : sc.next().toCharArray()) {
			n=((p=='.'||p=='S') && ch=='R') ? 1 : n;
			if (ch=='R' && p=='R') n++;
			p=ch;
		}
		System.out.println(n);
		sc.close();	
	}

	public static void main(String args[]) {
		solve();
	}

} Main
import java.util.*;
// warm-up
public class Main {

	static void solve() {
		Scanner sc = new Scanner(System.in);
		int n=0;
		char p='.';
		for (char ch : sc.next().toCharArray()) {
			n=((p=='.'||p=='S') && ch=='R') ? 1 : n;
			if (ch=='R' && p=='R') n++;
			p=ch;
		}
		System.out.println(n);
		sc.close();	
	}

	public static void main(String args[]) {
		solve();
	}

}
