#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, l = 0, r = 0, l1 = 0, r1 = 0, f = 0, f1 = 0, f2 = 0, f3 = 0, a, b;
  cin >> n;
  char s[100000];
  cin >> s;
  for (int i = 0; i < n; i++) {
    if (s[i] == 'R') {
      if (f == 0) {
        l = i + 1;
        f = 1;
      }
      r = i + 1;
    } else if (s[i] == 'L') {
      if (f1 == 0) {
        l1 = i + 1;
        f1 = 1;
      }
      r1 = i + 1;
    }
  }
  if (l > 0 && l1 > 0) {
    a = l;
    b = l1 - 1;
  } else if (l > 0) {
    a = l;
    b = r + 1;
  } else {
    a = r1;
    b = l1 - 1;
  }
  cout << a << " " << b << endl;
  return 0;
}
