#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, i = 0, m;
  char b, c;
  cin >> a;
  for (i; i < a; i++) {
    cin >> b;
    if (b != '.') {
      c = b;
      m = i + 1;
      break;
    }
  }
  for (i; i < a; i++) {
    cin >> b;
    if (b + c == 'L' + 'R') {
      cout << m << " " << i + 1;
      break;
    } else if (b + c == 'L' + '.') {
      cout << i + 1 << " " << m - 1;
      break;
    } else if (b + c == 'R' + '.') {
      cout << m << " " << i + 2;
      break;
    }
  }
  for (i; i < a; i++)
    ;
}
