#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
int main() {
  int n;
  cin >> n;
  string line;
  cin >> line;
  int cntr = count(((line).begin()), ((line).end()), 'R');
  int cntl = count(((line).begin()), ((line).end()), 'L');
  string s = "";
  for (int i = 0; i < ((int)((line).size())); i++)
    if (line[i] != '.') s += line[i];
  int idxr = line.find('R');
  int idxl = line.find('L');
  if (idxr == -1 || idxl == -1) {
    if (idxr > -1 && idxl == -1)
      cout << idxr + cntr << " " << idxr + cntr + 1 << endl;
    else if (idxl > -1 && idxr == -1)
      cout << idxl + 1 << " " << idxl << endl;
    return 0;
  }
  cout << min(idxr, idxl) + 1 << " "
       << ((idxr < idxl ? idxr : idxl) + ((int)((s).size()))) -
              (idxr > idxl ? cntr : cntl)
       << endl;
  return 0;
}
