#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  long long n;
  cin >> n;
  string s;
  cin >> s;
  s = "T" + s;
  if (s.find("L") == -1)
    cout << s.find("R") << " " << s.rfind("R") + 1 << endl;
  else
    cout << s.rfind("L") << " " << s.find("L") - 1;
  return 0;
}
