#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n;
  cin >> n;
  long long bal = 0, mn = 0;
  for (int i = 0; i < n; i++) {
    char c;
    cin >> c;
    if (c == '+')
      bal++;
    else
      bal--;
    mn = min(bal, mn);
  }
  cout << -1 * mn + bal;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long q = 1;
  while (q--) {
    solve();
  }
}
