#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const int maxn = 132222;
const long long mod = 1000000007;
char s[maxn];
int main() {
  int n;
  cin >> n;
  cin >> s + 1;
  int len = strlen(s + 1);
  int l = -1, r = -1;
  for (int i = (1); i < (len + 1); i++) {
    if (s[i] == 'L' && l == -1) l = i;
    if (s[i] == 'R' && r == -1) r = i;
  }
  if (l != -1 && r == -1) {
    int x;
    for (int i = len; i >= 1; i--) {
      if (s[i] == 'L') {
        x = i;
        break;
      }
    }
    cout << x << " " << l - 1 << endl;
    return 0;
  }
  if (l == -1 && r != -1) {
    int x;
    for (int i = len; i >= 1; i--) {
      if (s[i] == 'R') {
        x = i;
        break;
      }
    }
    cout << r << " " << x + 1 << endl;
    return 0;
  }
  if (l != -1 && r != -1) {
    cout << r << " " << l - 1 << endl;
    return 0;
  }
}
