#include #define foreach(i, v) for(__typeof((v).begin()) i = (v).begin(); i != (v).end(); ++ i) #define BETWEEN(a, x, b) (a<=x&&x>n>>s; int res = 0; for(int step=1;step= n) break; if (s[pos] == 'U' && s[pos + step] == 'M' && s[pos + step*2] == 'G') res++; } } cout<