#include using namespace std; using LL = long long; const LL LINF = 1e18; int main(){ int N;cin >> N; string str;cin >> str; LL ans = 0; for(int a = 0;a < N-2;a++){ if(str.at(a) != 'U')continue; for(int b = a+2;b