func_code_string: #include <bits/stdc++.h>   using namespace std;   signed main() {     long long T;     cin >> T;     while (T--) {       string s;       cin >> s;       long long ans = (long long)s.size(), curr = 0;       for (long long i = 0; i < s.size(); i++) {         if (s[i] ==  + ) {           curr++;         } else {           curr--;         }         if (curr < 0) {           ans += (i + 1);           curr++;         }       }       cout << ans << endl;     }   }   