#include <bits/stdc++.h>
using namespace std;
int n, m;
char a[400000];
int main() {
  cin >> n;
  int s = -1, t = -1;
  char ch;
  for (int i = 0; i < n; ++i) {
    cin >> ch;
    if (ch == 'R') t = i + 2;
    a[i] = ch;
    if (ch != '.' && s == -1) s = i + 1;
  }
  if (t == -1) t = s - 1;
  cout << s << " " << t;
}
