#include <bits/stdc++.h>
using namespace std;
stringstream ss;
long long mod = 1000000007LL;
int main() {
  int n;
  char x;
  cin >> n;
  vector<int> a(n + 2, 0), b;
  for (int i = 1; i <= n; i++) {
    cin >> x;
    if (x == 'L')
      a[i] = 1;
    else if (x == 'R')
      a[i] = 2;
  }
  for (int j = 1; j <= n; j++) {
    b = a;
    for (int i = 1; i <= n; i++)
      if (!b[i]) {
        if (a[i - 1] == 2) b[i] |= 2;
        if (a[i + 1] == 1) b[i] |= 1;
      }
    a = b;
  }
  int cnt = 0;
  for (int i = 1; i <= n; i++) cnt += (!a[i] || a[i] == 3);
  cout << cnt << endl;
  return 0;
}
