#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, count1 = 0, count2 = 0, x, y;
  cin >> n;
  string s;
  cin >> s;
  for (int i = 0; i < s.length(); i++) {
    if (s[i] == 'R')
      count1++;
    else if (s[i] == 'L')
      count2++;
  }
  if (count2 == 0) {
    for (int i = 0; i < s.size(); i++) {
      if (s[i] == 'R') {
        x = i + 1;
        break;
      }
    }
    y = count1 + x;
  } else if (count1 != 0 && count2 != 0) {
    for (int i = 0; i < s.size(); i++) {
      if (s[i] == 'R') {
        x = i + 1;
        break;
      }
    }
    y = count1 + x - 1;
  } else {
    for (int i = s.size(); i >= 0; i--) {
      if (s[i] == 'L') {
        x = i + 1;
        break;
      }
    }
    y = x - count2;
  }
  cout << x << " " << y;
  return 0;
}
