#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a, t, x = 0, f1 = 0, f2 = 0;
  int i;
  cin >> n;
  string s;
  cin >> s;
  for (i = 0; i < n; i++) {
    if (f1 == 0 && s[i] != '.') {
      a = i + 1;
      f1++;
    }
    if (f2 == 0 && s[i] == 'L') {
      t = i;
      f2++;
    }
    if (f2 == 0 && s[i] == 'R') t = i + 2;
  }
  cout << a << " " << t;
  return 0;
}
