#include <bits/stdc++.h>
using namespace std;
const int nMax = 1e4 + 10;
int s[nMax];
int main() {
  int n;
  scanf("%d", &n);
  getchar();
  for (int i = 1; i <= n; i++) {
    char c = getchar();
    if (c == 'L')
      s[i] = 2;
    else if (c == 'R')
      s[i] = 1;
    else
      s[i] = 0;
  }
  int x = n, y = 1;
  for (int i = 1; i <= n; i++)
    if (s[i] != 0) {
      x = i;
      break;
    }
  for (int i = n; i >= 1; i--)
    if (s[i] != 0) {
      y = i;
      break;
    }
  int ans = 0;
  if (x >= y) {
    if (x > y || s[x] == 0) {
      printf("%d\n", n);
      return 0;
    }
  }
  if (s[x] == 1) ans += (x - 1);
  if (s[y] == 2) ans += (n - y);
  for (int i = x; i <= y;) {
    if (s[i] == 1) {
      int countnum = 0;
      i++;
      while (i <= y && s[i] == 0) countnum++, i++;
      if (i <= y) {
        if (s[i] == 2) ans += (countnum % 2);
      }
    } else if (s[i] == 2) {
      int countnum = 0;
      i++;
      while (i <= y && s[i] == 0) countnum++, i++;
      if (i <= y) {
        if (s[i] == 1) ans += countnum;
      }
    }
  }
  cout << ans << endl;
}
