#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  string str;
  int len;
  cin >> len;
  cin >> str;
  int i, l;
  int count = 0, in_between = 0;
  bool flag_L = false, flag_R = false;
  int stand = 0;
  for (i = 0; i < str.length(); i++) {
    if (str[i] == '.')
      count++;
    else if (str[i] == 'L' && !flag_R)
      count = 0;
    else if (str[i] == 'R' && !flag_L) {
      stand += count;
      flag_R = true;
      count = 0;
    } else if (str[i] == 'L' && flag_R) {
      flag_R = false;
      if (count % 2 == 1) stand++;
      count = 0;
    }
  }
  if (!flag_R) stand += count;
  cout << stand << endl;
  return 0;
}
