#include <bits/stdc++.h>
using namespace std;
int main() {
  char s[3005];
  int i, j, k, n;
  while (cin >> n) {
    cin >> s;
    int count = 0, tempCount = 0;
    for (i = 0; i < n; i++) {
      tempCount++;
      if (s[i] == 'R') {
        tempCount--;
        count += tempCount;
        break;
      } else if (s[i] == 'L') {
        tempCount = 0;
        break;
      }
    }
    if (i == n) count = n;
    for (i = 0; i < n; i++) {
      tempCount = 0;
      if (s[i] == 'L') {
        for (j = i + 1; j < n; j++) {
          if (s[j] == 'R')
            break;
          else
            tempCount++;
        }
        count = count + (tempCount);
        i = j - 1;
      } else if (s[i] == 'R') {
        for (j = i + 1; j < n; j++) {
          if (s[j] == 'L')
            break;
          else
            tempCount++;
        }
        if (j == n) tempCount = 2;
        count = count + (tempCount % 2);
        i = j - 1;
      }
    }
    tempCount = 0;
    tempCount = 0;
    cout << count << "\n";
  }
  return 0;
}
