#include <bits/stdc++.h>
using namespace std;
template <class T>
void pp(T v) {
  for (__typeof((v).begin()) it = (v).begin(); it != (v).end(); ++it)
    cout << *it << ' ';
  cout << endl;
}
template <class T>
void pp(T v, int n) {
  for (int i = 0; i < (int)n; i++) cout << v[i] << ' ';
  cout << endl;
}
template <class T>
inline void chmax(T &a, const T b) {
  a = max(a, b);
}
template <class T>
inline void chmin(T &a, const T b) {
  a = min(a, b);
}
const int INF = 1 << 28;
const double EPS = 1.0e-9;
static const int dx[] = {1, 0, -1, 0}, dy[] = {0, -1, 0, 1};
int main(void) {
  int n;
  cin >> n;
  string s;
  cin >> s;
  bool r = false;
  int start = -1, goal = -1;
  for (int i = 0; i < (int)n; i++) {
    if (s[i] == 'R') {
      if (r == false) {
        r = true;
        start = i;
        goal = i;
      } else {
        goal = i;
      }
    } else if (r) {
      if (s[i] == 'L') {
        cout << start + 1 << " " << goal + 1 << endl;
      } else {
        cout << start + 1 << " " << goal + 2 << endl;
      }
      return 0;
    }
  }
  r = false;
  for (int i = 0; i < (int)n; i++) {
    if (s[i] == 'L') {
      if (r == false) {
        r = true;
        goal = i - 1;
        start = i;
      } else {
        start = i;
      }
    } else if (r) {
      cout << start + 1 << " " << goal + 1 << endl;
      return 0;
    }
  }
  return 0;
}
