#include <bits/stdc++.h>
using namespace std;
long long T;
long long n, c;
string s;
void solution() {
  cin >> n;
  cin >> s;
  c = 0;
  for (long long i = 0; i < n; ++i) {
    if (s[i] == '+') {
      ++c;
    } else if (c && s[i] == '-') {
      --c;
    }
  }
  cout << c << '\n';
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  T = 1;
  while (T--) solution();
}
