#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, s, t;
  cin >> n;
  vector<char> v;
  for (int i = 0; i < n; i++) {
    char x;
    cin >> x;
    v.emplace_back(x);
  }
  if (!count(v.begin(), v.end(), 'L')) {
    for (int i = 0; i < n - 1; i++) {
      if (v[i] == 'R' && (v[i + 1] == '.' || (i + 1) == n - 1)) {
        s = i + 1;
        t = i + 2;
      }
    }
    cout << s << " " << t;
    cout << endl;
    return 0;
  }
  if (!count(v.begin(), v.end(), 'R')) {
    for (int i = 0; i < n - 1; i++) {
      if (v[i] == '.' && v[i + 1] == 'L') {
        s = i + 2;
        t = i + 1;
      }
    }
    cout << s << " " << t << endl;
    return 0;
  }
  for (int i = 0; i < n; i++) {
    if (v[i] == '.' && v[i + 1] == 'R') {
      s = i + 2;
    }
    if (v[i] == 'R' && v[i + 1] == 'L') {
      t = i + 1;
      break;
    }
  }
  cout << s << " " << t;
  cout << endl;
  return 0;
}
