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