#include <bits/stdc++.h>
using namespace std;
const int maxn = 4e6 + 5;
const int inf = 0x3f3f3f3f;
int main() {
  int n;
  scanf("%d", &n);
  char a;
  getchar();
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    scanf("%c", &a);
    if (a == '-')
      ans--;
    else
      ans++;
    ans = max(0, ans);
  }
  printf("%d\n", ans);
}
