#include <bits/stdc++.h>
using namespace std;
struct ac {
  int dex;
  char dir;
};
char str[3005];
int main() {
  int n, ans;
  cin >> n >> str;
  ac last;
  last.dir = '.';
  last.dex = 0;
  ans = 0;
  for (int i = 0; i < n; i++) {
    if (str[i] == 'L') {
      if (last.dir == 'R') {
        ans += (i - last.dex - 1) % 2;
      }
      last.dex = i;
      last.dir = 'L';
    } else if (str[i] == 'R') {
      if (last.dir == 'L') {
        ans += (i - last.dex - 1);
      }
      if (last.dir == '.') {
        ans += i;
      }
      last.dir = 'R';
      last.dex = i;
    } else if (i == n - 1) {
      if (last.dir == 'L') ans += (i - last.dex);
    }
  }
  if (last.dir == '.') ans = n;
  cout << ans << endl;
  return 0;
}
