#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const double eps = 1e-12;
int main() {
  string a;
  int n, i, j;
  while (cin >> n) {
    cin >> a;
    int ans = 0;
    int sit = 0;
    int marki = 0;
    for (i = 0; i < n; i++) {
      if (a[i] == 'L') {
        marki = i + 1;
      }
      if (a[i] == 'R') {
        ans += i - marki;
        marki = i;
        while (a[i] != 'L' && i < n) {
          i++;
        }
        if (i != n) {
          if ((i - marki) % 2 == 0)
            ans++;
          else
            ans += 0;
          marki = i + 1;
        } else
          break;
      }
      if (i == n - 1) ans += n - marki;
    }
    cout << ans << endl;
  }
  return 0;
}
