func_code_string: #include <bits/stdc++.h>   using namespace std;   int main() {     int n, i, cnt = 0;     cin >> n;     char arr[n];     for (i = 0; i < n; i++) cin >> arr[i];     for (i = 0; i < n - 1; i++) {       if (arr[i] ==  U  && arr[i + 1] ==  R ) {         arr[i] =  D ;         arr[i + 1] =  D ;       } else if (arr[i] ==  R  && arr[i + 1] ==  U ) {         arr[i] =  D ;         arr[i + 1] =  D ;       }     }     for (i = 0; i < n; i++)       if (arr[i] ==  D ) ++cnt;     cout << n - cnt / 2;   }   