#include <bits/stdc++.h>
using namespace std;
int main() {
  int n = 0;
  cin >> n;
  char c;
  int f = 0, start, end;
  for (int i = 0; i < n; i++) {
    cin >> c;
    if (f == 0) {
      if (c == 'R') {
        f = 1;
        start = i + 1;
        cout << i + 1 << " ";
      } else if (c == 'L') {
        f = 2;
        end = i;
      }
    }
    if (f == 1) {
      if (c == 'L') {
        cout << i << endl;
        return 0;
      } else if (c == '.') {
        cout << i + 1 << endl;
        return 0;
      }
    }
    if (f == 2) {
      if (c == '.') {
        cout << i << " " << end << endl;
        return 0;
      }
    }
  }
  return 0;
}
