#include using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); int N; string S; cin >> N >> S; int D[3]{}; for (char c : S) { if (c == '-') D[0] = D[0] + 1; else if (c == '0') D[1] = max(D[0] + 1, D[1]); else D[2] = max({D[0], D[1], D[2]}) + 1; } cout << max({D[0], D[1], D[2]}) << endl; }