#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  s = " " + s;
  int index;
  index = 1;
  while (s[index] == '.') {
    index++;
  }
  if (s[index] == 'R') {
    cout << index;
    cout << " ";
    while (s[index] == 'R') {
      index++;
    }
    cout << index;
  } else {
    int i;
    i = index;
    while (s[index] == 'L') {
      index++;
    }
    cout << index - 1;
    cout << " ";
    cout << i - 1;
  }
  return 0;
}
