#include <bits/stdc++.h>
using namespace std;
const int maxn = 1000 + 100;
int n, x, y;
string str;
bool visited[maxn];
int main() {
  memset(visited, false, sizeof(visited));
  cin >> n;
  cin >> str;
  x = -1;
  y = -1;
  for (int i = 0; i < n; i++)
    if (x == -1 && str[i] != '.') {
      x = i;
      int j = i;
      while (y == -1) {
        if (visited[j]) {
          y = j;
        } else {
          visited[j] = true;
          if (str[j] == 'R') {
            j = j + 1;
          } else if (str[j] == 'L') {
            j = j - 1;
          }
        }
      }
    }
  cout << x + 1 << " " << y + 1 << endl;
  return 0;
}
