#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string pady;
  cin >> pady;
  int a = 0;
  int celkem = 0;
  int b = -1;
  while (b < n) {
    a = b + 1;
    while (pady[a] != 'R' && a < n) {
      a++;
      if (b > 0 && b < n) {
        celkem++;
      }
    }
    b = a;
    while (pady[b] != 'L' && b < n) {
      b++;
    }
    if (pady[a] == 'R' && pady[b] == 'L') {
      if ((b - a) % 2 == 0) {
        celkem++;
      }
    }
  }
  int zacatek = 0;
  int jeste = 0;
  while (pady[zacatek] != 'R' && zacatek < n) {
    if (pady[zacatek] == 'L') {
      jeste = -1;
    }
    zacatek++;
    jeste++;
  }
  celkem += jeste;
  cout << celkem;
  return 0;
}
