#include <bits/stdc++.h>   using namespace std;   const int MAXN = 3010;   const int INF = 0x3f3f3f3f;   int d[MAXN], e[MAXN];   int main() {     memset(d, INF, sizeof d);     memset(e, INF, sizeof e);     int n;     cin >> n;     string s;     cin >> s;     int at = INF;     for (int i = 0; i < n; i++) {       if (s[i] ==  R )         at = 0;       else if (s[i] ==  L )         at = INF;       d[i] = at;       if (at < INF) at++;     }     at = INF;     for (int i = n - 1; i >= 0; i--) {       if (s[i] ==  R )         at = INF;       else if (s[i] ==  L )         at = 0;       e[i] = at;       if (at < INF) at++;     }     int cont = 0;     for (int i = 0; i < n; i++) {       if (d[i] == e[i]) cont++;     }     cout << cont << endl;   }   