#include <bits/stdc++.h>
using namespace std;
const int mod = 998244353;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  char c = '+';
  int an = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '+') {
      an++;
    } else {
      an--;
      if (an < 0) an = 0;
    }
  }
  cout << an << endl;
}
