#include <bits/stdc++.h>
using namespace std;
signed main(void) {
  ios::sync_with_stdio(false);
  long long n;
  cin >> n;
  string s;
  cin >> s;
  vector<long long> ls(n, 0), rs(n, 0);
  long long cur = 0;
  for (long long i = 0; i < (long long)n; ++i) {
    if (s[i] == 'R') cur = 1;
    if (s[i] == 'L') cur = 0;
    if (cur != 0) rs[i] = cur++;
  }
  cur = 0;
  for (long long i = n - 1; i >= 0; --i) {
    if (s[i] == 'L') cur = 1;
    if (s[i] == 'R') cur = 0;
    if (cur != 0) ls[i] = cur++;
  }
  long long ret = 0;
  for (long long i = 0; i < (long long)n; ++i)
    ret += ((rs[i] == ls[i]) ? 1 : 0);
  cout << ret << "\n";
  return 0;
}
