#include <bits/stdc++.h>
int main() {
  int numDominoes;
  char dominoes[3005];
  int fallen = 0;
  int count = 0;
  int isL = 0;
  int seenR = 0;
  scanf("%d", &numDominoes);
  for (int i = 0; i <= numDominoes; i++) {
    scanf("%c", &dominoes[i]);
  }
  for (int i = 1; i <= numDominoes; i++) {
    if (dominoes[i] == '.') {
      count++;
    } else if (dominoes[i] == 'R') {
      count = 0;
      fallen++;
      for (int j = i; j <= numDominoes; j++) {
        if (dominoes[j] == 'L') {
          isL = 1;
          break;
        }
      }
      if (isL == 0) {
        fallen += numDominoes - i;
      }
      isL = 0;
      seenR = 1;
    } else if (dominoes[i] == 'L') {
      fallen++;
      if (count > 0 && seenR == 1) {
        if (count % 2 == 0) {
          fallen += count;
        } else {
          fallen += count - 1;
        }
      } else {
        fallen += count;
      }
      count = 0;
    }
  }
  printf("%d\n", numDominoes - fallen);
  return 0;
}
