#include <bits/stdc++.h>
using namespace std;
long long modpow(long long a, long long n, long long temp) {
  long long res = 1, y = a;
  while (n > 0) {
    if (n & 1) res = (res * y) % temp;
    y = (y * y) % temp;
    n /= 2;
  }
  return res % temp;
}
long long ison(long long mask, long long pos) { return (mask & (1 << pos)); }
long long cbit(long long n) {
  long long k = 0;
  while (n) n &= (n - 1), k++;
  return k;
}
long long nbit(long long n) {
  long long k = 0;
  while (n) n /= 2, k++;
  return k;
}
long long mod = 1e9 + 7;
int sgn(long long x) { return x < 0 ? -1 : !!x; }
vector<pair<long long, long long> > e[100007];
long long n;
vector<long long> distra(long long s) {
  vector<long long> d(n, mod), vis(n);
  d[s] = 0;
  set<pair<long long, long long> > q;
  q.insert(make_pair(0, s));
  while (!q.empty()) {
    long long v = q.begin()->second;
    q.erase(q.begin());
    vis[v] = 1;
    for (long long i = 0; i < e[v].size(); i++) {
      long long u = e[v][i].first;
      long long nd = d[v] + e[v][i].second;
      if (vis[u]) continue;
      if (d[u] <= nd) continue;
      q.erase(make_pair(d[u], u));
      d[u] = nd;
      q.insert(make_pair(d[u], u));
    }
  }
  return d;
}
long long a[500005], b[500005], c[500005];
char s[5005], last;
int main() {
  long long n, i, j, pos = 0, sol = 0;
  cin >> n >> (s + 1);
  for (i = 1; s[i]; i++) {
    if (s[i] == '.') continue;
    if (s[i] == 'R') {
      pos = i;
      last = 'R';
    } else {
      last = 'L';
      if (pos) {
        if ((i - pos + 1) & 1)
          sol += (i - pos + 1) - 1;
        else
          sol += (i - pos + 1);
      } else
        sol += i;
    }
  }
  if (last == 'R') {
    i--;
    while (s[i] != 'R') {
      --i, ++sol;
    }
    ++sol;
  }
  cout << n - sol;
}
