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