# include <iostream>
# include <map>
# include <stdlib.h>
using namespace std;
int main()
{
int n;
cin >> n;
long long arr[101];
int maxx =0;
int count=0;
map <long long, long long> p;
for(int i=0;i<n;i++)
{
char temp;
cin >> temp;
cin >> arr[i];
if (temp == '-')
arr[i]*=-1;
p[abs(arr[i])]+=arr[i];
if (arr[i]>0)
count+=1;
else
{
count-=1;
if(p[abs(arr[i])]<0){
maxx+=1;
count+=1;
}
}
if (count > maxx)
maxx=count;
}
cout << maxx;
return 0;
}
IyBpbmNsdWRlIDxpb3N0cmVhbT4KIyBpbmNsdWRlIDxtYXA+CiMgaW5jbHVkZSA8c3RkbGliLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgppbnQgbWFpbigpCnsKICAgICAgICBpbnQgbjsKICAgICAgICBjaW4gPj4gbjsKICAgICAgICBsb25nIGxvbmcgYXJyWzEwMV07CiAgICAgICAgaW50IG1heHggPTA7CiAgICAgICAgaW50IGNvdW50PTA7CiAgICAgICAgbWFwIDxsb25nIGxvbmcsIGxvbmcgbG9uZz4gcDsKICAgICAgICBmb3IoaW50IGk9MDtpPG47aSsrKQogICAgICAgIHsKICAgICAgICAgICAgICAgIGNoYXIgdGVtcDsKICAgICAgICAgICAgICAgIGNpbiA+PiB0ZW1wOwogICAgICAgICAgICAgICAgY2luID4+IGFycltpXTsKICAgICAgICAgICAgICAgIGlmICh0ZW1wID09ICctJykKICAgICAgICAgICAgICAgICAgICAgICAgYXJyW2ldKj0tMTsKCiAgICAgICAgICAgICAgICBwW2FicyhhcnJbaV0pXSs9YXJyW2ldOwoKICAgICAgICAgICAgICAgIGlmIChhcnJbaV0+MCkKICAgICAgICAgICAgICAgICAgICAgICAgY291bnQrPTE7CiAgICAgICAgICAgICAgICBlbHNlCiAgICAgICAgICAgICAgICB7CiAgICAgICAgICAgICAgICAgICAgICAgIGNvdW50LT0xOwogICAgICAgICAgICAgICAgICAgICAgICBpZihwW2FicyhhcnJbaV0pXTwwKXsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtYXh4Kz0xOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvdW50Kz0xOwogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICBpZiAoY291bnQgPiBtYXh4KQogICAgICAgICAgICAgICAgICAgICAgICBtYXh4PWNvdW50OwoKICAgICAgICB9CgoKICAgICAgICBjb3V0IDw8IG1heHg7CiAgICAgICAgcmV0dXJuIDA7Cn0K