#include <bits/stdc++.h>

using namespace std;



int main() {

  char arr[10];
  scanf("%s", arr);
  int rCount = 0, ans = 0;
  for (int i = 0; i < 3; ++i) {
    if (arr[i] == 'R') {
      rCount++;
    } else {
      ans = max(ans, rCount);
      rCount = 0;
    }
  }
  ans = max(ans, rCount);
  printf("%d\n", ans);
  

  return 0;
}
#include<bits/stdc++.h>
#include<unordered_map>
using namespace std;
using Graph = vector<vector<int>>;
#define ll long long
#define all(x) (x).begin(),(x).end()
#define rep(i, n) for(ll i = 0; i < n; i++)
const ll INF = 1LL << 60;

int main(){
    int N;
    cin >> N;
    cout << N / 3 << endl;
}
