func_code_string: #include <bits/stdc++.h>   using namespace std;   void go() {     ios_base::sync_with_stdio(0);     cin.tie(0);     cout << fixed;     cout << setprecision(6);   }   void solve() {     string s;     cin >> s;     long long n = s.size();     vector<long long> arr(n);     long long cur = 0;     for (long long i = 0; i < n; i++) {       if (s[i] ==  + )         cur++;       else         cur--;       arr[i] = cur;     }     map<long long, long long> mp;     for (long long i = n - 1; i >= 0; i--) {       if (arr[i] < 0) mp[arr[i]] = i + 1;     }     long long ans = n;     for (auto x : mp) {       ans += x.second;     }     cout << ans <<   n ;   }   signed main() {     go();     long long t = 1;     cin >> t;     while (t--) solve();     return 0;   }   