#include using namespace std; int main(){ int n;cin>>n; int ans=0; string s;cin>>s; for(int i=0;in-1){ break; } else{ if(s[i]=='U'&&s[j]=='M'&&s[2*j-i]=='G'){ ans++; } } } } cout<