#include <bits/stdc++.h>
using namespace std;
int n;
string s;
int res = 0;
bool visit[3010] = {0};
int main() {
  cin >> n;
  cin >> s;
  n += 2;
  s = 'L' + s + 'R';
  for (int i = 0; i < n; i++) {
    if (s[i] == 'L') {
      for (int j = i - 1; j >= 0; j--) {
        if (s[j] == '.') continue;
        if (s[j] == 'R') {
          res += (i - j - 1) % 2;
          break;
        } else
          break;
      }
      for (int j = i + 1; j < n; j++) {
        if (s[j] == '.') continue;
        if (s[j] == 'R') {
          res += j - i - 1;
          break;
        } else
          break;
      }
    }
  }
  cout << res;
  return 0;
}
