#include <bits/stdc++.h>
using namespace std;
int MAX = 100010;
int MOD = (long long)1000000000 + 7;
long long INF = 1e17;
const double pi = acos(-1);
const double EPS = 1e-10;
typedef pair<long long, int> P;
int main() {
  int N;
  string S;
  cin >> N >> S;
  int ans = 0;
  for (int i = 0; i < N; i++) {
    if (S[i] == '+') {
      ans = max(ans + 1, 0);
    } else {
      ans = max(ans - 1, 0);
    }
  }
  cout << ans << endl;
  ;
}
