#include <bits/stdc++.h>
using namespace std;
int mod = 1000000007;
inline int toInt(string s) {
  int v;
  istringstream sin(s);
  sin >> v;
  return v;
}
inline long long toll(string s) {
  long long v;
  istringstream sin(s);
  sin >> v;
  return v;
}
template <class T>
inline string toString(T x) {
  ostringstream sout;
  sout << x;
  return sout.str();
}
int dcmp(double x, double y) {
  return fabs(x - y) <= 1e-9 ? 0 : x < y ? -1 : 1;
}
void printV(vector<int> v) {
  for (int i = 0; i < v.size(); i++) {
    if (i) {
      cout << " " << v[i];
    } else
      cout << v[i];
  }
}
int fixMod(int a) { return (a % mod + mod) % mod; }
int cnt[1000000 + 6];
int main() {
  int n;
  cin >> n;
  int curVis = 0;
  int maxi = 0;
  for (int i = 0; i < n; i++) {
    char c;
    cin >> c;
    int cur;
    cin >> cur;
    if (c == '+') {
      if (cnt[cur] == 0) {
        curVis++;
        cnt[cur] = 1;
      }
      maxi = max(maxi, curVis);
    } else {
      if (cnt[cur] == 0) {
        maxi++;
      } else {
        curVis--;
        cnt[cur] = 0;
      }
    }
  }
  cout << maxi << endl;
  return 0;
}
