#include <bits/stdc++.h>
using namespace std;
int arr[5000];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  string s;
  cin >> s >> s;
  for (int w = 0; w < s.size(); w++) {
    if (s[w] == 'L') {
      int k = 1;
      arr[w] -= k;
      for (int i = w - 1; i >= 0; i--) {
        k++;
        if (s[i] == '.')
          arr[i] -= k;
        else
          break;
      }
    } else if (s[w] == 'R') {
      int k = 1;
      arr[w] += k;
      for (int i = w + 1; i < s.size(); i++) {
        k++;
        if (s[i] == '.')
          arr[i] += k;
        else
          break;
      }
    }
  }
  int res = 0;
  for (int w = 0; w < s.size(); w++) {
    if (arr[w] == 0) {
      res++;
    }
  }
  cout << res << endl;
  return 0;
}
