#include <bits/stdc++.h>
using namespace std;
int ara[3333];
int n;
string s;
int main() {
  cin >> n;
  cin >> s;
  int i, j, k, l, c = 0;
  for (i = 0; i < n; i++) {
    if (s[i] != '.') continue;
    j = -1;
    k = -1;
    for (l = i - 1; l >= 0; l--) {
      if (s[l] == '.') continue;
      if (s[l] == 'R') j = l;
      break;
    }
    for (l = i + 1; l < n; l++) {
      if (s[l] == '.') continue;
      if (s[l] == 'L') k = l;
      break;
    }
    if (j != -1 && k != -1 && (i - j) == (k - i))
      c++;
    else if (j == -1 && k == -1)
      c++;
  }
  cout << c << '\n';
  return 0;
}
