#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int i;
  for (i = 0; i < n; i++) {
    if (s[i] != '.') {
      break;
    }
  }
  int j;
  for (j = s.size() - 1; j >= 0; j--) {
    if (s[j] != '.') {
      break;
    }
  }
  int lc = 0;
  int rc = 0;
  for (int k = i; k <= j; k++) {
    if (s[k] == 'L') {
      lc++;
    } else {
      rc++;
    }
  }
  if (lc == 0) {
    cout << i + 1 << " " << j + 2 << endl;
  } else if (rc == 0) {
    cout << j + 1 << " " << i << endl;
  } else {
    int l;
    for (l = i; l <= j; l++) {
      if (s[l] == 'L') {
        break;
      }
    }
    cout << i + 1 << " " << l << endl;
  }
  return 0;
}
