#include <bits/stdc++.h>
using namespace std;
int n;
char str[3100];
bool vis[3100];
int main() {
  scanf("%d", &n);
  scanf("%s", str);
  memset(vis, false, sizeof(vis));
  int ans = 0;
  char pre = '.';
  int p = -1;
  for (int i = 0; i < n; i++) {
    char c = str[i];
    if ('.' == c)
      continue;
    else if ('L' == c) {
      vis[i] = true;
      if ('.' == pre) {
        for (int j = i; j > p; j--) {
          vis[j] = true;
        }
      } else if ('L' == pre) {
        for (int j = i; j > p; j--) {
          vis[j] = true;
        }
      } else if ('R' == pre) {
        if ((i - p) % 2 == 0) {
          ans++;
        }
      }
    } else if ('R' == c) {
      vis[i] = true;
      for (int j = i + 1; j < n; j++) {
        if (str[j] != '.') break;
        vis[j] = true;
      }
    }
    pre = str[i];
    p = i;
  }
  for (int i = 0; i < n; i++)
    if (!vis[i]) ans++;
  printf("%d\n", ans);
}
