#include <bits/stdc++.h>
using namespace std;
char str[3005];
int n, vis1[3005], vis2[3005];
int main() {
  scanf("%d", &n);
  scanf("%s", str + 1);
  memset(vis1, -1, sizeof(vis1));
  memset(vis2, -1, sizeof(vis2));
  for (int i = 1; i <= n; i++) {
    if (str[i] == 'L') {
      int cou = 1;
      for (int j = i - 1; j >= 1 && str[j] != 'R'; j--) {
        vis1[j] = cou;
        cou++;
      }
    } else if (str[i] == 'R') {
      int cou = 1;
      for (int j = i + 1; j <= n && str[j] != 'L'; j++) {
        vis2[j] = cou;
        cou++;
      }
    }
  }
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    if (str[i] == 'R' || str[i] == 'L') continue;
    if (vis1[i] == -1 && vis2[i] == -1)
      ans++;
    else if (vis1[i] == vis2[i])
      ans++;
  }
  printf("%d\n", ans);
  return 0;
}
