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