#include <bits/stdc++.h>
using namespace std;
char mas[10010];
int main() {
  ios::sync_with_stdio(0);
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) cin >> mas[i];
  int s, t;
  s = -1;
  for (int i = 0; i < n; ++i)
    if (mas[i] != '.' && mas[i] != 'L') {
      s = i;
      break;
    }
  if (s == -1) {
    for (int i = 0; i < n; ++i)
      if (mas[i] != '.') s = i;
  }
  t = -1;
  for (int i = 1; i < n; ++i)
    if (mas[i] != '.' && mas[i - 1] != '.')
      if (mas[i] != mas[i - 1]) {
        t = i;
        break;
      }
  if (t == -1) {
    for (int i = 1; i < n; ++i)
      if (mas[i] != '.') {
        t = i;
        if (mas[i] == 'L') break;
      }
  }
  if (mas[t] == 'R')
    ++t;
  else
    --t;
  cout << s + 1 << " " << t + 1 << endl;
  return 0;
}
