#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int r = -1, l = -1, el = -1, er = -1;
  for (int i = 0; i < n; i++) {
    if (isalpha(s[i])) {
      if (s[i] == 'R' && r == -1)
        r = i;
      else if (s[i] == 'L' && l == -1)
        l = i;
      if (s[i] == 'L')
        el = i;
      else
        er = i;
    }
  }
  if (r != -1 && l != -1)
    cout << r + 1 << " " << l << "\n";
  else if (r != -1)
    cout << r + 1 << " " << er + 2 << "\n";
  else
    cout << el + 1 << " " << l << "\n";
}
