#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, min = 0, tmpCount = 0;
  string str, tmpStr;
  set<string> hashTable;
  cin >> n;
  getchar();
  for (int i = 0; i < n; ++i) {
    getline(cin, str);
    if (str[0] == '+') {
      tmpCount++;
      tmpStr = str.substr(2);
      hashTable.insert(tmpStr);
      if (tmpCount > min) {
        min = tmpCount;
      }
    } else {
      tmpStr = str.substr(2);
      if (hashTable.find(tmpStr) != hashTable.end()) {
        hashTable.erase(tmpStr);
        tmpCount--;
      } else {
        min++;
      }
    }
  }
  cout << min << endl;
  return 0;
}
