#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string str;
  cin >> str;
  int l = 0;
  int r = 0;
  int index = -1;
  for (int i = 0; i < n - 1; ++i) {
    if (str[i] == 'L') ++l;
    if (str[i] == 'R') ++r;
    if (str[i] == 'R' && str[i + 1] == 'L') index = i + 1;
  }
  if (l == 0 && r == 0) {
    cout << 1 << endl;
    return 0;
  }
  if (index == -1) {
    if (l != 0) {
      bool f = false;
      for (int i = n - 1; i >= 0; --i) {
        if (str[i] == 'L' && !f) {
          f = true;
          cout << i + 1 << " ";
        }
        if (str[i] == '.' && f) {
          cout << i + 1 << endl;
          return 0;
        }
      }
    }
    if (r != 0) {
      bool f = false;
      for (int i = 0; i < n - 1; ++i) {
        if (str[i] == 'R' && !f) {
          f = true;
          cout << i + 1 << " ";
        }
        if (str[i + 1] == '.' && f) {
          cout << i + 2 << endl;
          return 0;
        }
      }
    }
  }
  if (index != -1) {
    for (int i = 0; i < n; ++i) {
      if (str[i + 1] == 'R') {
        cout << i + 2 << " " << index << endl;
        return 0;
      }
    }
  }
  return 0;
}
