#include <bits/stdc++.h>
using namespace std;
int n, id[3050], tp[3050], cnt = 0, ans = 0;
char a[3050];
int main() {
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    cin >> a[i];
    if (a[i] != '.') {
      ++cnt;
      id[cnt] = i;
      tp[cnt] = (a[i] == 'L' ? 0 : 1);
    }
  }
  if (cnt == 0) {
    cout << n;
    return 0;
  }
  if (cnt == 1) {
    if (a[id[1]] == 'L')
      cout << n - id[1];
    else
      cout << id[1] - 1;
    return 0;
  }
  for (int i = 1; i <= cnt; ++i) {
    if (a[id[i]] == 'R') {
      if (i != cnt) ans += ((id[i + 1] - id[i] - 1) % 2 == 1 ? 1 : 0);
      if (i == 1) ans += id[i] - 1;
    } else {
      if (i != cnt)
        ans += id[i + 1] - id[i] - 1;
      else
        ans += n - id[i];
    }
  }
  cout << ans;
  return 0;
}
