package main;
import java.util.*;
/* LRLR */
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
String line = in.nextLine();
int firstR = line.indexOf('R');
if (firstR == -1) {
System.out.println(line.length());
return;
}
int result = firstR + 1;
int count = 0;
for (int i = firstR + 1; i < line.length(); i++) {
if(line.charAt(i) == 'R') {
count++;
}
if(count > 0 && line.charAt(i) == 'L') {
count = 0;
}
}
result += count;
System.out.println(result);
}
}