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