#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:16777216")
#pragma warning(disable : 4786)
using namespace std;
template <class T>
inline T MAX(T a, T b) {
  return a > b ? a : b;
}
template <class T>
inline T MIN(T a, T b) {
  return a < b ? a : b;
}
template <class T>
inline void SWAP(T &a, T &b) {
  a = a ^ b;
  b = a ^ b;
  a = a ^ b;
}
template <class T, class T1>
inline void Reverse(T1 A[], T i, T j) {
  for (; i < j; i++, j--) SWAP(A[i], A[j]);
}
template <class T>
inline T fAbs(T a) {
  return a < 0 ? a * (-1) : a;
}
const int sz = 3e3 + 10;
const int inf = 1 << 29;
const double PI = 2 * acos(0.0);
const double eps = 1e-9;
char str[sz];
int arr[sz];
int main() {
  memset((str), (0), sizeof((str)));
  memset((arr), (0), sizeof((arr)));
  int n;
  scanf("%d", &n);
  scanf("%s", str);
  int i, tmp, j;
  for (i = 0; i < n; i++) {
    if (str[i] == 'L') {
      tmp = -1;
      j = i;
      arr[j] += tmp;
      j--;
      tmp--;
      while (j >= 0 && str[j] == '.') {
        arr[j] += tmp;
        j--;
        tmp--;
      }
    } else if (str[i] == 'R') {
      tmp = 1;
      j = i;
      arr[j] = tmp;
      tmp++;
      j++;
      while (j < n && str[j] == '.') {
        arr[j] += tmp;
        tmp++;
        j++;
      }
    }
  }
  int cnt = 0;
  for (i = 0; i < n; i++)
    if (arr[i] == 0) cnt++;
  printf("%d\n", cnt);
  return 0;
}
