#include <bits/stdc++.h>
using namespace std;
long long mod(long long a) {
  if (a < 0) {
    return -1 * a;
  } else {
    return a;
  }
}
bool isPerfectSquare(long long x) {
  if (x >= 0) {
    long long sr = sqrt(x);
    return (sr * sr == x);
  }
  return false;
}
bool isPrime(long long n) {
  if (n == 0 || n == 1) return false;
  for (int i = 2; i * i <= n; i++) {
    if (n % i == 0) return false;
  }
  return true;
}
int binarySearch(int arr[], int l, int r, int x) {
  while (l <= r) {
    int m = l + (r - l) / 2;
    if (arr[m] == x) return m;
    if (arr[m] < x)
      l = m + 1;
    else
      r = m - 1;
  }
  return -1;
}
bool findPartiion(int arr[], int n) {
  int sum = 0;
  int i, j;
  for (i = 0; i < n; i++) sum += arr[i];
  if (sum % 2 != 0) return false;
  bool part[sum / 2 + 1];
  for (i = 0; i <= sum / 2; i++) {
    part[i] = 0;
  }
  for (i = 0; i < n; i++) {
    for (j = sum / 2; j >= arr[i]; j--) {
      if (part[j - arr[i]] == 1 || j == arr[i]) part[j] = 1;
    }
  }
  return part[sum / 2];
}
int solve() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int res = 0;
  vector<int> a;
  for (size_t i = 0; i < n; ++i) {
    if (s[i] == 'L' || s[i] == 'R') {
      a.push_back(i + 1);
    }
  }
  if (a.size() == 1) {
    if (s[a[0] - 1] == 'R') {
      return a[0] - 1;
    } else {
      return n - a[0];
    }
  }
  if (a.size() == 0) {
    return n;
  }
  for (size_t i = 0; i < a.size() - 1; ++i) {
    if (s[a[i + 1] - 1] == 'L' && s[a[i] - 1] == 'R') {
      if ((a[i + 1] - a[i] - 1) % 2 != 0) res++;
    } else if (s[a[i + 1] - 1] == 'R' && s[a[i] - 1] == 'L')
      res += a[i + 1] - a[i] - 1;
  }
  if (s[a[a.size() - 1] - 1] == 'L') {
    res += n - a[a.size() - 1];
  }
  if (s[a[0] - 1] == 'R') {
    res += a[0] - 1;
  }
  return res;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  int t = 1;
  while (t--) {
    cout << solve() << endl;
  }
  return 0;
}
