#include <bits/stdc++.h>
using namespace std;
char ch;
int main() {
  int s, t, n, lastr, lastt;
  scanf("%d", &n);
  s = -1;
  t = -1;
  getchar();
  for (int i = 0; i < n; i++) {
    scanf("%c", &ch);
    if (ch == 'R' && s == -1) s = i + 1;
    if (ch == 'R' && s > 0) lastr = i + 1;
    if (ch == 'L' && t == -1) t = i;
    if (ch == 'L' && t > 0) lastt = i;
  }
  if (t == -1) {
    t = lastr + 1;
  }
  if (s == -1) {
    s = lastt + 1;
    t = t;
  }
  cout << s << " " << t;
  return 0;
}
