#include<bits/stdc++.h> using namespace std; int n,a,l,r; string s; int main(){ cin>>n>>s; for (int i = 0; i < n; ++i){ if(s[i]=='L') l++; else r++; }cout<<(l+r)+1<<"\n"; }
Codeforces Round #613 (Div. 2)---Solution of Problem A
#include<bits/stdc++.h> using namespace std; int n,a,l,r; string s; int main(){ cin>>n>>s; for (int i = 0; i < n; ++i){ if(s[i]=='L') l++; else r++; }cout<<(l+r)+1<<"\n"; }