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