#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
int main(int argc, char* argv[]) {
  int n;
  cin >> n;
  vector<char> mas(n);
  for (int i = 0; i < n; i++) {
    cin >> mas[i];
  }
  int s, t;
  for (int i = 0; i < n; i++)
    if (mas[i] != '.') {
      if (mas[i] == 'L') {
        t = i;
        for (int j = i; j < n && mas[j] != '.'; j++) s = j + 1;
      } else {
        for (int j = i; j < n; j++) {
          if (mas[j] == 'L' || mas[j] == '.') {
            t = j + 1;
            break;
          }
        }
        for (int j = i; j < n && mas[j] != '.'; j++) s = j + 1;
      }
      break;
    };
  cout << s << ' ' << t << endl;
  return 0;
}
