#include #include #include #include #include #include using namespace std; #define ll long long int int main() { ll n; cin>>n; string s; cin>>s; ll l=s.length(); ll c=0; ll a[l+1]; if(s[0]=='U') a[0]=1; else a[0]=(-1); for(int i=1;i=a[i-1]) c++; } cout<