#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
const double eps = 1e-11;
const int mod = 1e9 + 7;
template <class T>
inline void readInt(T &n) {
  n = 0;
  T ch = getchar();
  int sign = 1;
  while (ch < '0' || ch > '9') {
    if (ch == '-') sign = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9')
    n = (n << 3) + (n << 1) + ch - '0', ch = getchar();
  n = n * sign;
}
char a[10000];
int main() {
  int n, st = 0, ans = 0, l = -1, r = -1;
  cin >> n;
  scanf("%s", a);
  for (int i = ((int)(0)); i < ((int)(n)); i++) {
    if (a[i] == 'L') {
      if (l == -1 && r == -1) {
        l = 1;
        r = 0;
        st = i;
      } else {
        if ((i - st) % 2 == 0) ans++;
        l = 1;
        r = 0;
        st = i;
      }
    }
    if (a[i] == 'R') {
      if (l == -1 && r == -1) {
        ans += i;
        l = 0;
        r = 1;
        st = i;
      } else {
        ans += i - st - 1;
        l = 0;
        r = 1;
        st = i;
      }
    }
    if (a[i] == '.') {
      if (i != (n - 1))
        continue;
      else {
        if (l == 1) ans += n - 1 - st;
      }
    }
  }
  if (l == -1 && r == -1) ans = n;
  cout << ans << endl;
}
