#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  string s;
  cin >> s;
  int aux = -1;
  int count = 0;
  int ans = 0;
  int i = 0;
  int st, e;
  while (s[i] == '.' && i < n) ++i;
  if (i == n) {
    printf("%d\n", n);
    return 0;
  }
  if (s[i] == 'R') ans += i;
  st = i;
  i = n - 1;
  while (s[i] == '.' && i > -1) --i;
  if (s[i] == 'L') ans += (n - i - 1);
  e = i;
  char p = s[st];
  for (i = st + 1; i <= e; ++i) {
    if (s[i] == 'L' || s[i] == 'R') {
      if (p == 'L') {
        ans += count;
        p = s[i];
        count = 0;
      } else {
        ans += (count & 1);
        count = 0;
        p = s[i];
      }
    } else
      count++;
  }
  printf("%d\n", ans);
  return 0;
}
