#include <bits/stdc++.h>
using namespace std;
void fast() {
  ios::sync_with_stdio(false);
  cin.tie(0);
}
void cv(vector<long long> a) {
  cout << "\n";
  for (int i = 0; i < (int)a.size(); i++) cout << a[i] << " ";
  cout << "\n";
}
int main() {
  fast();
  long n, s = 0;
  cin >> n;
  bool pocetak = false;
  for (int i = 0; i < n; i++) {
    char c;
    cin >> c;
    if (!pocetak) {
      if (c == '+') {
        pocetak = true;
        s++;
      }
    } else {
      if (c == '+')
        s++;
      else
        s--;
      if (s < 0) s = 0;
    }
  }
  cout << s << "\n";
  return 0;
}
