#include <bits/stdc++.h>
using namespace std;
int still_standing(string s, int start, int end) {
  if (start > end) return 0;
  if (start == end) {
    if (s[start] == '.')
      return 1;
    else
      return 0;
  }
  for (int i = start; i <= end; i++) {
    if (s[i] == 'L') return still_standing(s, i + 1, end);
    if (s[i] == 'R') {
      int beforefirstR = i - start;
      for (int j = i + 1; j <= end; j++) {
        if (s[j] == 'R') return beforefirstR + still_standing(s, j, end);
        if (s[j] == 'L') {
          return beforefirstR + (j - i + 1) % 2 + still_standing(s, j + 1, end);
        }
      }
      return beforefirstR;
    }
  }
  return (end - start + 1);
}
int main() {
  int n;
  string s;
  cin >> n >> s;
  cout << still_standing(s, 0, n - 1) << endl;
}
