#include <bits/stdc++.h>
using namespace std;
int n;
int res = 0;
char x;
int main() {
  bool check = false;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> x;
    if (x == '+')
      res++;
    else
      res--;
    if (res < 0) res = 0;
  }
  cout << res;
}
