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