#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, ans = 0, ct = 0;
  cin >> n;
  char a[n];
  int b[n];
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    if (a[i] == '.') b[i] = 0;
    if (a[i] == 'L') b[i] = 1;
    if (a[i] == 'R') b[i] = 2;
  }
  for (int i = 0; i < n; ++i) {
    if (b[i] == 1) {
      for (int j = i - 1; j >= 0; j--) {
        if (b[j] == 2) break;
        b[j] = 1;
      }
    }
    if (b[i] == 2) {
      for (int j = i + 1; j < n; ++j) {
        if (b[j] == 1) break;
        b[j] = 2;
      }
    }
  }
  for (int i = 0; i < n; ++i) {
    if (b[i] == 0) ans++;
    for (int j = i; j < n; ++j)
      if (b[j] == 1) {
        while (b[i] == 2) {
          i++;
          ct++;
        }
        if (ct != 0 && ct % 2 == 0) ans++;
        ct = 0;
      }
  }
  cout << ans << endl;
}
