#include <bits/stdc++.h>
using namespace std;
long long gcd(long long ar1, long long ar2) {
  return ar2 == 0 ? ar1 : gcd(ar2, ar1 % ar2);
}
long long add(long long ar1, long long ar2, long long m = 1000000007) {
  if (ar1 >= m) ar1 %= m;
  if (ar2 >= m) ar2 %= m;
  if (ar1 < 0) ar1 += m;
  if (ar2 < 0) ar2 += m;
  long long res = ar1 + ar2;
  if (res >= m or res <= -m) res %= m;
  if (res < 0) res += m;
  return res;
}
long long mul(long long ar1, long long ar2, long long m = 1000000007) {
  if (ar1 >= m) ar1 %= m;
  if (ar2 >= m) ar2 %= m;
  if (ar1 < 0) ar1 += m;
  if (ar2 < 0) ar2 += m;
  long long res = ar1 * ar2;
  if (res >= m or res <= -m) res %= m;
  if (res < 0) res += m;
  return res;
}
long long pow_mod(long long ar1, long long ar2, long long m = 1000000007) {
  long long res = 1;
  ar1 = ar1 % m;
  while (ar2) {
    if (ar2 & 1) res = mul(res, ar1, m);
    ar2 >>= 1;
    ar1 = mul(ar1, ar1, m);
  }
  return res;
}
long long fastexp(long long ar1, long long ar2) {
  long long res = 1;
  while (ar2) {
    if (ar2 & 1) res = res * ar1;
    ar2 >>= 1;
    ar1 *= ar1;
  }
  return res;
}
long long gcdExtendido(long long ar1, long long ar2, long long *x,
                       long long *y) {
  if (ar1 == 0) {
    *x = 0;
    *y = 1;
    return ar2;
  }
  long long x1, y1;
  long long gcd = gcdExtendido(ar2 % ar1, ar1, &x1, &y1);
  *x = y1 - (ar2 / ar1) * x1;
  *y = x1;
  return gcd;
}
long long modInverso(long long ar1, long long m) {
  long long x, y;
  long long g = gcdExtendido(ar1, m, &x, &y);
  if (g != 1)
    return -1;
  else
    return (x % m + m) % m;
}
long long isPrime(long long n) {
  if (n == 1) return 0;
  if (n == 2) return 1;
  if ((n % 2) == 0) return 0;
  for (long long i = 3; i <= sqrt(n); i += 2) {
    if (n % i == 0) return 0;
  }
  return 1;
}
bool sortbysec(const pair<long long, long long> &ar1,
               const pair<long long, long long> &ar2) {
  return (ar1.first < ar2.first);
}
long long fact(long long n) {
  if (n <= 1) return 1;
  return mul(n, fact(n - 1), 1000000007);
}
vector<long long> store;
void seive(long long n) {
  vector<long long> prime;
  for (long long i = 0; i <= 10000000; i++) {
    prime.push_back(1);
  }
  for (long long p = 2; p * p <= n; p++) {
    if (prime[p]) {
      for (long long i = p * p; i <= n; i += p) prime[i] = 0;
    }
  }
  for (long long i = 2; i < n; i++) {
    if (prime[i]) store.push_back(i);
  }
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n;
  cin >> n;
  string s;
  cin >> s;
  long long l = 0, st = 0;
  long long pos;
  for (long long i = 0; i < s.length(); i++) {
    if (st == 0 && s[i] != '.') {
      st = i + 1;
    }
    if (st != 0 && s[i] == '.') {
      l = i + 1;
      break;
    }
    if (st != 0 && s[i] == 'L') {
      l = i;
      break;
    }
  }
  cout << st << " " << l << '\n';
  return 0;
}
