#include <bits/stdc++.h>
using namespace std;
long long int power(long long int x, long long int y, long long int p) {
  long long int res = 1;
  x = x % p;
  while (y > 0) {
    if (y & 1) {
      res = (res * x) % p;
    }
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
long long int modInverse(long long int n, long long int p) {
  return power(n, p - 2, p);
}
long long int factorial(long long int n) {
  if (n == 0) {
    return 1;
  } else if (n == 1) {
    return 1;
  } else {
    return factorial(n - 1) * n;
  }
}
long long int nCr(long long int n, long long int r, long long int p) {
  if (r == 0) {
    return 1;
  }
  long long int fac[n + 1];
  fac[0] = 1;
  for (long long int i = 1; i <= n; i++) {
    fac[i] = fac[i - 1] * i % p;
  }
  return (fac[n] * modInverse(fac[r], p) % p * modInverse(fac[n - r], p) % p) %
         p;
}
int main() {
  long long int ans = 0, i = 0, j = 0;
  long long int n;
  ;
  cin >> n;
  string s;
  cin >> s;
  while (s[i] == '.') i++;
  while (n > 0 && s[n - 1] == '.') s[n--] = 'L';
  while (s[j] != 'L') j++;
  cout << i + 1 << " " << j;
  return 0;
}
