#include <bits/stdc++.h>
using namespace std;
const int maxn = 3100;
char s[maxn];
int n;
int main() {
  scanf("%d", &n);
  scanf("%s", s);
  int cnt = 0, ans = 0;
  bool fleft = false, fright = false;
  for (int i = 0; i < n; i++) {
    if (s[i] == '.') cnt++;
    if (s[i] == 'R') {
      if (fleft == 1 && fright == 0)
        ans += cnt;
      else if (fleft == 0 && fright == 1)
        ans += 0;
      else if (fleft == 0 && fright == 0)
        ans += cnt;
      cnt = 0, fleft = 0, fright = 1;
    }
    if (s[i] == 'L') {
      if (fleft == 1 && fright == 0)
        cnt = 0;
      else if (fleft == 0 && fright == 1) {
        if (cnt & 1) ans++;
        cnt = 0;
      } else if (fleft == 0 && fright == 0) {
        cnt = 0;
      }
      fleft = 1, fright = 0;
    }
  }
  if (fleft == 1)
    ans += cnt;
  else if (fleft == 0 && fright == 0)
    ans += cnt;
  printf("%d\n", ans);
  return 0;
}
