#include <bits/stdc++.h>
using namespace std;
int main() {
  string foot;
  int n, i = 0, j = 0;
  cin >> n >> foot;
  while (foot[i] == '.') i++;
  while (n > 0 && foot[n - 1] == '.') foot[n--] = 'L';
  while (foot[j] != 'L') j++;
  cout << i + 1 << " " << j;
  return 0;
}
