#include <bits/stdc++.h>
using namespace std;
char s[3001];
int main() {
  int len;
  cin >> len >> s;
  int ans = 0, cnt = 0, last = -1;
  for (int i = 0; s[i]; i++) {
    if (s[i] == '.')
      cnt++;
    else if (s[i] == 'L') {
      if (last != -1) {
        ans += cnt % 2;
      }
      last = 0;
      cnt = 0;
    } else if (s[i] == 'R') {
      ans += cnt;
      last = 1;
      cnt = 0;
    }
  }
  if (last == 0 || last == -1) ans += cnt;
  cout << ans << endl;
  return 0;
}
