#include <bits/stdc++.h>
using namespace std;
const int INF = 10000;
int main() {
  int n;
  cin >> n;
  vector<pair<int, int> > d(n, make_pair(INF, INF));
  char tmp;
  for (int i = 0; i < n; i++) {
    cin >> tmp;
    if (tmp == 'L')
      d[i].first = 1;
    else if (tmp == 'R')
      d[i].second = 1;
  }
  for (int i = 1; i < n; i++) {
    if (d[i].first != 1) d[i].second = min(d[i].second, d[i - 1].second + 1);
  }
  for (int i = n - 2; i >= 0; i--) {
    if (d[i].second != 1) d[i].first = min(d[i].first, d[i + 1].first + 1);
  }
  int ans = 0;
  for (int i = 0; i < n; i++) {
    if (d[i].first == d[i].second) ans++;
  }
  cout << ans << endl;
  return 0;
}
