#include <bits/stdc++.h>
char p[1001];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) scanf(" %c ", &p[i]);
  int s = 0;
  while (p[s] == '.') s++;
  int r = s;
  while (p[r] != '.') r++;
  int t = r;
  while (p[t - 1] == 'L') t--;
  if (p[t] != '.') t--;
  printf("%d %d\n", s + 1, t + 1);
  return 0;
}
