#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, x = 0, ans = 0;
  cin >> n;
  string s;
  cin >> s;
  bool check = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == 'R') {
      check = 1;
      ans += x;
      x = 0;
    }
    if (s[i] == 'L' && check) {
      if (x % 2) ans++;
      x = 0;
      check = 0;
    }
    if (s[i] == '.')
      x++;
    else
      x = 0;
  }
  if (!check) ans += x;
  x = 0;
  cout << ans << endl;
}
