#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  while (cin >> n) {
    string s;
    cin >> s;
    int ans = 0, cnt = 0;
    bool push = false;
    for (int i = 0; i < n; ++i) {
      switch (s[i]) {
        case 'R':
          if (!push) ans += cnt;
          cnt = 0;
          push = true;
          break;
        case 'L':
          if (push) {
            if (cnt % 2) ++ans;
          }
          cnt = 0;
          push = false;
          break;
        case '.':
          ++cnt;
          break;
      }
    }
    if (!push) ans += cnt;
    cout << ans << endl;
  }
  return 0;
}
