#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<char> step(n + 1);
  int s = 0;
  int t = 0;
  bool read = false;
  int last = 0;
  for (int i = 1; i <= n; i++) {
    cin >> step[i];
    if (not read and step[i] != '.') read = true;
    if (s == 0 and step[i] == 'R') s = i;
    if (t == 0 and step[i] == 'L') t = i;
    if (read and step[i] == '.' and last == 0) last = i;
  }
  if (s != 0 and t != 0)
    cout << s << " " << t - 1 << endl;
  else if (s == 0)
    cout << last - 1 << " " << t - 1 << endl;
  else if (t == 0)
    cout << s << " " << last << endl;
}
