#include <bits/stdc++.h>
using namespace std;
int n;
char str[1010101];
int main() {
  scanf("%d", &n);
  scanf("%s", str);
  int ans = 0;
  int flag = 0;
  int num = 0, l = 1, r = 0;
  for (int i = 0; i < n; i++) {
    if (str[i] == '.') {
      num++;
    }
    if (str[i] == 'L') {
      if (r == 1) {
        ans += (num % 2);
      }
      r = 0;
      l = 1;
      num = 0;
    }
    if (str[i] == 'R') {
      if (l == 1) {
        ans += num;
      }
      l = 0;
      r = 1;
      num = 0;
    }
  }
  if (l == 1) ans += num;
  cout << ans << endl;
  return 0;
}
