#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    string s;
    cin >> s;
    int c = 0, ans = 0;
    for (int i = 0; i < s.length(); i++) {
      if (s[i] == 'R')
        c = 0;
      else
        c++;
      ans = max(ans, c);
    }
    cout << ans + 1 << " ";
  }
  return 0;
}
