#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
int main() {
  int n, i, j, ans, c, stand;
  string s;
  cin >> n >> s;
  if (n == 1) {
    if (s[0] == '.')
      cout << 1 << '\n';
    else
      cout << 0 << '\n';
    return 0;
  }
  ans = stand = 0;
  for (i = 0; i < n; i++) {
    if (s[i] == '.') {
      c = 0;
      while (s[i] == '.' && i < n) {
        c++;
        i++;
      }
      if (s[i] == 'L') c = 0;
      ans += c;
      i--;
    } else if (s[i] == 'R') {
      c = 0;
      while (s[i] != 'L' && i < n) {
        c++;
        i++;
      }
      c++;
      if (s[i] == 'L' && c % 2)
        c = 1;
      else if (s[i] == 'L' && c % 2 == 0)
        c = 0;
      else
        c = 0;
      ans += c;
    }
  }
  cout << ans << '\n';
  return 0;
}
