#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  long long n;
  cin >> n;
  string s;
  cin >> s;
  for (long long i = 0; i < n - 1; i++) {
    if (s[i] == 'R' && s[i + 1] == 'L') {
      cout << i + 1 << " " << i + 1 << endl;
      exit(0);
    }
  }
  for (long long i = 0; i < n; i++) {
    if (s[i] == 'L') {
      cout << i + 1 << " " << i << endl;
      exit(0);
    }
  }
  for (long long i = n - 1; i >= 0; i--) {
    if (s[i] == 'R') {
      cout << i + 1 << " " << i + 2 << endl;
      return 0;
    }
  }
  return 0;
}
