#include <bits/stdc++.h>
using namespace std;
int main() {
  char ss[3005];
  int n;
  scanf("%d", &n);
  getchar();
  scanf("%s", ss);
  int ans = 0, num = 0, r = -1, l = -1;
  for (int i = 0; i < n; i++) {
    if (ss[i] == '.')
      num++;
    else if (ss[i] == 'L') {
      if (r == -1)
        num = 0;
      else {
        if ((i - r - 1) % 2)
          ans++, num = 0, r = -1, l = -1;
        else
          num = 0, r = -1, l = -1;
      }
    } else if (ss[i] == 'R') {
      ans += num, num = 0, r = i;
    }
  }
  if (r != -1) num = 0;
  printf("%d\n", ans + num);
  return 0;
}
