#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100005;
int v[MAXN];
int main() {
  int n;
  while (cin >> n) {
    string s;
    cin >> s;
    int res = 0;
    for (int i = 0; i < n; ++i) {
      if (s[i] != '.') continue;
      int R = -1, L = -1;
      for (int j = i + 1; j < n; ++j) {
        if (s[j] == 'R') break;
        if (s[j] == 'L') R = j - i;
      }
      for (int j = i - 1; j >= 0; j--) {
        if (s[j] == 'L') break;
        if (s[j] == 'R') L = i - j;
      }
      if (R == L) res++;
    }
    cout << res << endl;
  }
}
