#include <bits/stdc++.h>
using namespace std;
int n, ri, li, rf, lf;
string road;
int main() {
  cin >> n >> road;
  for (int i = 1; i <= n; i++) {
    if (road[i - 1] == 'R' && !ri) {
      ri = i;
    }
    if (road[i - 1] == 'L' && !li) {
      li = i;
    }
    if ((road[i - 1] == 'L' && !rf) || (road[i - 1] == '.' && ri && !rf)) {
      rf = i - 1;
    }
    if (road[i - 1] == '.' && !lf && li) {
      lf = i - 1;
    }
  }
  if (ri && li)
    cout << ri << " " << li - 1 << endl;
  else if (!li)
    cout << ri << " " << rf + 1 << endl;
  else if (!ri)
    cout << lf << " " << li - 1 << endl;
  return 0;
}
