#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, n, s, t;
  char start, end;
  cin >> n;
  char arr[n];
  for (i = 0; i < n; i++) cin >> arr[i];
  for (i = 0; i < n; i++) {
    if (arr[i] == 'R' || arr[i] == 'L') {
      s = i;
      start = arr[i];
      break;
    }
  }
  for (i = n - 1; i >= 0; i--) {
    if (arr[i] == 'R' || arr[i] == 'L') {
      t = i;
      end = arr[i];
      break;
    }
  }
  if (start == 'L' && end == 'L' && s != t) {
    cout << t << " " << s;
    exit(0);
  }
  if (start == 'L' && end == 'L' && s == t) {
    cout << s + 1 << " " << s;
    exit(0);
  }
  if (start == 'R' && end == 'R' && s != t) {
    cout << s + 1 << " " << t + 2;
    exit(0);
  }
  if (start == 'R' && end == 'R' && s == t) {
    cout << s + 1 << " " << s + 2;
    exit(0);
  } else if (start == 'R' && end == 'L') {
    int p = s;
    while (2) {
      if (arr[p] == 'R' && arr[p + 1] == 'L') {
        cout << s + 1 << " " << p + 1;
        exit(0);
      } else
        p++;
    }
  }
}
