#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  vector<pair<int, char> > v;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] != '.') {
      v.push_back(make_pair(i, s[i]));
    }
  }
  if (v.size() == 0) {
    cout << n << endl;
    return 0;
  }
  int cnt = 0;
  if (v[0].second == 'R' && v[0].first != 0) {
    cnt += v[0].first;
  }
  if (v[v.size() - 1].second == 'L' && v[v.size() - 1].first != n - 1) {
    cnt += n - 1 - v[v.size() - 1].first;
  }
  for (int i = 0; i < v.size() - 1; i++) {
    if (v[i].second == 'R' && v[i + 1].second == 'L') {
      if ((v[i + 1].first - v[i].first) % 2 == 0) cnt++;
    } else {
      cnt += v[i + 1].first - v[i].first - 1;
    }
  }
  cout << cnt << endl;
  return 0;
}
