#include <bits/stdc++.h>
using namespace std;
const int N = 100000;
int main() {
  int n;
  scanf("%d", &n);
  string s;
  cin >> s;
  bool f1 = 0, f2 = 0;
  int firR = 0, firL = 0, lastR = 0, lastL = 0;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == 'R' && !f1) firR = i + 1, f1 = 1;
    if (s[i] == 'L' && !f2) firL = i + 1, f2 = 1;
    if (s[i] == 'L') lastL = i + 1;
    if (s[i] == 'R') lastR = i + 1;
  }
  if (firL == 0 && lastL == 0)
    printf("%d %d\n", firR, lastR + 1);
  else if (firR == 0 && lastR == 0)
    printf("%d %d\n", lastL, firL - 1);
  else
    printf("%d %d\n", firR, firL - 1);
}
