#include <bits/stdc++.h>
using namespace std;
long long n, x, tmp, st, en;
string s;
char ch = '!';
bool R = false, L = false;
int main() {
  cin >> n;
  cin >> s;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == 'R' && !R) {
      st = i + 1;
      R = true;
    }
    if (s[i] == 'R' && R) {
      en = i + 2;
      R = true;
    } else if (s[i] == 'L' && R) {
      en = i;
      L = true;
      break;
    } else if (s[i] == 'L') {
      st = i;
      L = true;
      while (s[i] == 'L') i++;
      en = i;
      break;
    }
  }
  if (R && L)
    cout << st << " " << en << endl;
  else if (R)
    cout << st << " " << en << endl;
  else if (L) {
    cout << en << " " << st << endl;
  }
  return 0;
}
