#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n = 0;
  cin >> n;
  char input, before = '.';
  int start = 0, end = 0, lastfoot = 0;
  bool foundFirstR = false, foundfirstL = false;
  for (int i = 1; i <= n; i++) {
    cin >> input;
    if (input == 'R' && !foundFirstR) {
      start = i;
      foundFirstR = true;
    } else if (input == 'L' && !foundfirstL) {
      end = i - 1;
      foundfirstL = true;
    } else if (before == 'R' || before == 'L') {
      lastfoot = i;
    }
    before = input;
  }
  if (foundfirstL && foundFirstR) {
    cout << start << " " << end;
  } else if (!foundFirstR) {
    cout << lastfoot - 1 << " " << end;
  } else {
    cout << start << " " << lastfoot;
  }
}
