#include<bits/stdc++.h>
using namespace std;
#define ll long long int

int main(){
  char s[3];
  cin>>s[0]>>s[1]>>s[2];
  int max=0, locmax=0;
  for(int i=0;i<3;i++){
    if(s[i] == 'R'){
      locmax++;
    }
    else{
      locmax=0;
    }
    if(locmax>max){
      max=locmax;
    }
  }
  cout<<max;
}
      

#include<iostream>
#include<cmath>
using namespace std;
int main()
{
    int a, b, c, k, x, y, z;
    cin >> a >> b >> c >> k;
    if(a >= b && a >= c)
    {x = a; y = b; z = c;}
    if(b > a && b >= c)
    {x = b; y = c; z = a;}
    else if(c > a && c > b)
    {x = c; y = a; z = b;}
    while(k > 0)
    {
        k--;
        x = x * 2;
    }
    cout << y + z + x;
    return 0;
}