#include <bits/stdc++.h>
using namespace std;
const int MAX = 5e5 + 10, mod = 1e9 + 9, base = 41, INF = 1e9 + 10, sq = 502;
int main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL);
  long long n, ind1 = 0, ind2 = 0, ind3 = 0;
  cin >> n;
  long long m = n;
  string s;
  cin >> s;
  string a;
  for (long long i = 0; i < (n); ++i) {
    if (s[i] != '.' and a.size() == 0) {
      a = s[i];
      m = i + 1;
    }
    if (i > m - 1) {
      if (s[i] != a[0]) {
        ind2 = i + 1;
        a += s[i];
        break;
      }
    }
  }
  if (a[0] == 'L')
    cout << ind2 - 1 << " " << m - 1 << endl;
  else {
    if (a[1] == '.')
      cout << m << " " << ind2 << endl;
    else {
      for (long long i = ind2; i <= n - 1; i++) {
        if (s[i] != a[1]) {
          ind3 = i + 1;
          break;
        }
      }
      cout << ind3 - 1 << " " << ind2 << endl;
    }
  }
  return 0;
}
