#include using namespace std; #define int long long void testcase() { int N; cin >> N; string S; cin >> S; int max_count = 0, count = 0; for (int i = 0; i < S.size(); i++) { bool minus_ok = 0, zero_ok = 0, plus_ok = 0; for (int j = i; j < S.size(); j++) { if (S[j] == '-' && !zero_ok && !plus_ok) count++; if (S[j] == '0' && !plus_ok) { count++; zero_ok = 1; } if (S[j] == '+') { count++; plus_ok = 1; } } max_count = max(max_count, count); count = 0; } cout << max_count << '\n'; } int32_t main() { ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); testcase(); return 0; }