#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e4;
vector<int> ans;
int a[maxn], n, nearL[maxn], nearR[maxn];
string input;
int main() {
  cin >> n;
  cin >> input;
  memset(nearL, -1, sizeof(nearL));
  memset(nearR, -1, sizeof(nearR));
  int R = -1;
  int L = -1;
  for (int i = 0; i < n; i++) {
    if (input[i] == 'R') R = i;
    if (input[i] == 'L') R = -1;
    nearR[i] = R;
  }
  for (int i = n - 1; i >= 0; i--) {
    if (input[i] == 'L') L = i;
    if (input[i] == 'R') L = -1;
    nearL[i] = L;
  }
  for (int i = 0; i < n; i++) {
    if (nearR[i] == -1 && nearL[i] == -1)
      ans.push_back(i);
    else if (i - nearR[i] == nearL[i] - i && nearR[i] != -1 && nearL[i] != -1)
      ans.push_back(i);
  }
  cout << ans.size() << endl;
  ;
  return 0;
}
