#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
const int NMAX = 202020;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  int ans = 0;
  for (int i = 0; i < n; i++) {
    char c;
    cin >> c;
    if (c == '+')
      ans++;
    else
      ans--;
    ans = max(ans, 0);
  }
  cout << ans;
  return 0;
}
