#include <bits/stdc++.h>
using namespace std;
long long GCD(long long a, long long b) { return (a) ? GCD(b % a, a) : b; }
long long LCM(long long a, long long b) { return a * b / GCD(a, b); }
double power(double a, long long b) {
  double x = 1;
  for (int i = 0; i < b; i++) {
    x = x * a;
  }
  return x;
}
int main() {
  int n;
  cin >> n;
  char a;
  int start, end;
  for (int i = 0; i < n; i++) {
    cin >> a;
    if (a == 'R') {
      start = i + 1;
      end = start;
      while (cin >> a && a == 'R') {
        end++;
      }
      if (a == '.') {
        end = end + 1;
      }
      break;
    } else if (a == 'L') {
      end = i;
      start = end;
      while (cin >> a && a != '.') {
        start++;
      }
      start = start + 1;
      break;
    }
  }
  cout << start << " " << end << endl;
  return 0;
}
