#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  string s;
  cin >> s;
  long long t = s.size();
  long long c = 0;
  vector<long long> a(t, 0);
  for (long long i = 0; i < t; i++) {
    if (s[i] == 'L' && a[i] == 0) {
      a[i] = 1;
      for (long long j = i - 1; j >= 0; j--) {
        if (s[j] == 'R' && a[j] == 0) {
          if ((j - i) % 2 == 0) c++;
          a[j] = 1;
          break;
        }
        a[j] = 1;
      }
    } else if (s[i] == 'R' && a[i] == 0) {
      a[i] = 1;
      for (long long j = i + 1; j < t; j++) {
        if (s[j] == 'L' && a[j] == 0) {
          if ((j - i) % 2 == 0) c++;
          a[j] = 1;
          break;
        }
        a[j] = 1;
      }
    }
  }
  for (long long i = 0; i < t; i++) {
    if (a[i] == 0) c++;
  }
  cout << c << endl;
  return 0;
}
