#include <bits/stdc++.h>
using namespace std;
const int Maxn = 100010;
int val[Maxn];
char str[Maxn];
int main() {
  int i, j, k;
  int n, m, ra, rb, ret, tmp;
  while (~scanf("%d%s", &n, str + 1)) {
    ra = rb = -1;
    for (i = 1; i <= n; i++)
      if (str[i] == 'R') break;
    ra = i;
    if (ra > n) {
      for (i = n; i > 0; i--)
        if (str[i] == 'L') break;
      rb = i;
      for (i = rb; i > 0; i--)
        if (str[i] == '.') break;
      ra = i;
      swap(ra, rb);
    } else {
      for (i = 1; i <= n; i++)
        if (str[i] == 'L') break;
      rb = i;
      if (rb > n) {
        for (i = ra; i < n; i++)
          if (str[i] == '.') break;
        rb = i;
      } else
        rb--;
    }
    printf("%d %d\n", ra, rb);
  }
  return 0;
}
