#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, c1 = 0, c2 = 0;
  string s;
  cin >> n >> s;
  for (int i = 0; i < n; i++) {
    if (s[i] == '.') c1++;
    if (s[i] == 'L') c1 = 0;
    if (s[i] == 'R') {
      c2 += c1;
      c1 = 0;
      while (s[i + 1] != 'L' and i != n) {
        c1++;
        i++;
      }
      if (s[i + 1] == 'L' and c1 % 2 != 0) c2++;
      c1 = 0;
    }
  }
  cout << c1 + c2;
  return 0;
}
