#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  int cnt = 0, a = 0;
  for (int i = n - 1; i >= 0; --i) {
    if (s[i] == '+')
      cnt++;
    else
      cnt--;
    a = max(a, cnt);
  }
  cout << a << endl;
  return 0;
}
