#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6;
const int mod = 1e9 + 7;
void solve() {
  long long n;
  cin >> n;
  string s;
  cin >> s;
  int ans = n;
  int l = -1, r = -1;
  for (int i = 0; i < n; i++) {
    if (s[i] == 'L') {
      l = i;
      if (r == -1)
        ans -= l + 1;
      else {
        int temp = abs(l - r) + 1;
        if (temp & 1) ans++;
        ans -= temp;
      }
    } else if (s[i] == 'R') {
      r = i;
    }
  }
  if (r > l) {
    ans -= n - r;
  }
  cout << ans << '\n';
}
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  long long test = 1;
  while (test--) {
    solve();
  }
  return 0;
}
