#include <bits/stdc++.h>
using namespace std;
void Fast() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
}
void File() {}
int fact(int n) {
  if (n <= 1) return 1;
  return ((n) * (fact(n - 1)));
}
int nPr(int n, int r) { return fact(n) / fact(n - r); }
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
int main() {
  Fast(), File();
  string s;
  int n;
  cin >> n;
  cin >> s;
  if (s.find('R') == -1) {
    cout << s.find_last_of('L') + 1 << " " << s.find_first_of('L') << "\n";
  } else if (s.find('L') == -1)
    cout << s.find_first_of('R') + 1 << " " << s.find_last_of('R') + 2 << "\n";
  else
    cout << s.find_first_of('R') + 1 << " " << s.find_last_of('R') + 1 << "\n";
}
