#include <bits/stdc++.h>
using namespace std;
int res(int i, string& s) {
  int h = i;
  for (auto c : s) {
    if (c == '+')
      ++h;
    else {
      --h;
      if (h < 0) return -1;
    }
  }
  return h;
}
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  string s;
  cin >> n >> s;
  for (int i = 0; i <= n; ++i) {
    auto r = res(i, s);
    if (r >= 0) {
      cout << r << "\n";
      break;
    }
  }
  return 0;
}
