#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, j, k, n;
  char dump[3];
  while (scanf("%d", &n) == 1) {
    gets(dump);
    char a[n + 10];
    gets(a);
    i = 0;
    j = 0;
    while (a[i] != '\0') {
      if (a[i] == 'L') {
        j = 0;
        break;
      } else if (a[i] == 'R') {
        j = i;
        break;
      }
      i++;
      j++;
    }
    if (a[i] == 'L') i++;
    while (a[i] != '\0') {
      if (a[i] == 'R') {
        k = 0;
        while (1) {
          i++;
          if (a[i] == 'L') {
            if (k % 2) j++;
            break;
          } else if (a[i] == '\0')
            break;
          k++;
        }
      }
      if (a[i] == '.') {
        j++;
        i++;
      }
      if (a[i] == 'L') i++;
    }
    printf("%d\n", j);
  }
  return 0;
}
