#include <bits/stdc++.h>
using namespace std;
int main() {
  int test;
  cin >> test;
  char ch = getchar();
  map<string, int> mymap;
  int min = 0, count = 0, count2 = 0;
  string str;
  char c, b;
  c = '+';
  while (test--) {
    b = c;
    c = getchar();
    ch = getchar();
    getline(cin, str);
    if (c == '+') {
      mymap[str] = 1;
      count++;
      min = max(min, count);
    } else if (mymap[str] == 1 && c == '-') {
      mymap[str] = 0;
      count--;
      min = max(min, count);
    } else if (mymap[str] == 0 && c == '-') {
      min++;
      mymap[str] = 0;
    }
  }
  cout << min << endl;
  return 0;
}
