#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n;
  string s;
  cin >> n;
  cin >> s;
  vector<int> v1(n, 0);
  vector<int> v2(n, 0);
  for (int i = 0; i < n; i++) {
    if (s[i] == 'L' || s[i] == 'R') {
      v1[i] = 1;
      v2[i] = 1;
      if (s[i] == 'L') {
        int dis = -1;
        for (int j = i - 1; j >= 0 && s[j] == '.'; j--) {
          v1[j] = dis;
          dis--;
        }
      }
      if (s[i] == 'R') {
        int dis = 1;
        for (int j = i + 1; j < n && s[j] == '.'; j++) {
          v2[j] = dis;
          dis++;
        }
      }
    }
  }
  int num = 0;
  for (int i = 0; i < n; i++) {
    if ((v1[i] + v2[i]) == 0) num++;
  }
  cout << num;
}
