#include <bits/stdc++.h>
using namespace std;
int a[3005];
int main() {
  int i, ln, p, q, s = 0, t;
  bool f1 = false, f2 = false;
  scanf("%d", &ln);
  string n;
  cin >> n;
  for (i = 1; i <= ln; i++) {
    if (n[i - 1] == 'R')
      a[i] = 1;
    else if (n[i - 1] == 'L')
      a[i] = 2;
  }
  p = 1;
  while (true) {
    if (a[p] == 2) break;
    if (a[p] == 1) {
      f1 = true;
      p--;
      break;
    }
    p++;
    if (p > ln) break;
  }
  q = ln;
  while (true) {
    if (a[q] == 1) break;
    if (a[q] == 2) {
      f2 = true;
      q++;
      break;
    }
    q--;
    if (q < 1) break;
  }
  if (p > ln && q < 1) {
    printf("%d\n", ln);
    return 0;
  }
  if (f1 == true) s += p;
  if (f2 == true) s += ln - q + 1;
  t = p;
  for (i = p; i <= q; i++) {
    int x = i, y = i + 1;
    while (x <= q && a[x] != 1) x++;
    while (y <= q && a[y] != 2) y++;
    if (x == q + 1 && y == q + 1) {
      if (q - i > 0) s += q - i - 1;
      break;
    }
    s += x - t - 1;
    if ((y - x) % 2 == 0) s++;
    i = y;
    t = y;
  }
  printf("%d\n", s);
  return 0;
}
