#include <bits/stdc++.h>
char s[1002];
int rs, re, ls, le;
int main() {
  int i, n;
  scanf("%d", &n);
  scanf("%s", s);
  ls = le = rs = re = -1;
  for (i = 0; s[i]; i++)
    if (s[i] == 'L') {
      ls = i;
      break;
    }
  for (; s[i]; i++)
    if (s[i] == 'L') le = i;
  for (i = 0; s[i]; i++)
    if (s[i] == 'R') {
      rs = i;
      break;
    }
  for (; s[i]; i++)
    if (s[i] == 'R') re = i;
  if (re == -1 && rs == -1)
    printf("%d %d\n", le + 1, ls);
  else if (le == -1 && ls == -1)
    printf("%d %d\n", rs + 1, re + 2);
  else
    printf("%d %d\n", rs + 1, re + 1);
  return 0;
}
