#include <bits/stdc++.h>
using namespace std;
int main() {
  ios ::sync_with_stdio(false);
  int n;
  string s;
  while (cin >> n >> s) {
    int firstR = -1, lastR = -1;
    int firstL = -1, lastL = -1;
    for (int i = 0, _a = (n); i < _a; i++) {
      if (s[i] == 'R') {
        if (firstR < 0) firstR = i;
        lastR = i;
      }
      if (s[i] == 'L') {
        if (firstL < 0) firstL = i;
        lastL = i;
      }
    }
    int s, t;
    if (firstR < 0) {
      s = lastL;
      t = firstL - 1;
    } else if (firstL < 0) {
      s = firstR;
      t = lastR + 1;
    } else {
      s = firstR;
      t = lastR;
    }
    cout << s + 1 << ' ' << t + 1 << endl;
  }
}
