#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, s = 0, t = 0;
  string road;
  cin >> n >> road;
  for (int i = 1; i < n; ++i) {
    if (road[i] == 'L') {
      t = i;
      for (int j = i + 1; j < n; ++j) {
        if (road[j] == '.') {
          s = j;
          break;
        }
      }
      break;
    } else if (road[i] == 'R') {
      s = i + 1;
      for (int j = i + 1; j < n; ++j) {
        if (road[j] != 'R') {
          t = (road[j] == '.' ? j + 1 : j);
          break;
        }
      }
      break;
    }
  }
  cout << s << " " << t << endl;
  return 0;
}
