#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, len, head = 0, tail = 0;
  char s[1001];
  scanf("%d%s", &n, s);
  len = strlen(s);
  for (int i = 1; i < len - 1; i++)
    if (s[i] == 'R') {
      if (s[i - 1] == '.') head = i;
      if (s[i + 1] == 'L')
        tail = i;
      else if (s[i + 1] == '.')
        tail = i + 1;
    }
  if (head && tail)
    printf("%d %d\n", head + 1, tail + 1);
  else {
    for (int i = 1; i < len - 1; i++)
      if (s[i] == 'L') {
        if (s[i - 1] == '.') tail = i - 1;
        if (s[i + 1] == 'R')
          head = i;
        else if (s[i + 1] == '.')
          head = i;
      }
    printf("%d %d\n", head + 1, tail + 1);
  }
  return 0;
}
