#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int x = 0, y = 0, ok = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == 'R' && ok == 0) {
      x = i + 1;
      ok = 1;
    }
    if ((s[i] == 'L' && s[i - 1] == 'R') && ok == 1) {
      y = i;
      break;
    }
    if (s[i] == '.' && s[i - 1] == 'R' && ok == 1) {
      y = i + 1;
      break;
    }
    if (s[i] == 'L' && ok == 0) {
      y = i;
      ok = 1;
    }
    if ((s[i] == 'L' && s[i + 1] == '.') && ok == 1) {
      x = i + 1;
      break;
    }
  }
  cout << x << " " << y;
}
