#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  char ch[3000];
  int i;
  cin >> n;
  cin >> ch;
  int l = 0, r = 0;
  int c = 0;
  int ans = 0;
  int j;
  for (i = 0; i < n; i++) {
    if (ch[i] == '.') {
      c++;
    }
    if (ch[i] == 'L') {
      c = 0;
    }
    if (ch[i] == 'R') {
      ans += c;
      c = 0;
      j = i + 1;
      while (j != n && ch[j] != 'L') {
        c++;
        j++;
      }
      if (c % 2 == 1 && j != n) {
        ans++;
      }
      c = 0;
      i = j;
    }
  }
  ans += c;
  cout << ans;
  return 0;
}
