Berland National Library has recently been built in the capital of Berland. In addition, in the library you can take any of the collected works of Berland leaders, the library has a reading room.

Today was the pilot launch of an automated reading room visitors' accounting system! The scanner of the system is installed at the entrance to the reading room. It records the events of the form "reader entered room", "reader left room". Every reader is assigned a registration number during the registration procedure at the library — it's a unique integer from 1 to 106. Thus, the system logs events of two forms:

  * "+ ri" — the reader with registration number ri entered the room; 
  * "- ri" — the reader with registration number ri left the room. 



The first launch of the system was a success, it functioned for some period of time, and, at the time of its launch and at the time of its shutdown, the reading room may already have visitors.

Significant funds of the budget of Berland have been spent on the design and installation of the system. Therefore, some of the citizens of the capital now demand to explain the need for this system and the benefits that its implementation will bring. Now, the developers of the system need to urgently come up with reasons for its existence.

Help the system developers to find the minimum possible capacity of the reading room (in visitors) using the log of the system available to you.

Input

The first line contains a positive integer n (1 ≤ n ≤ 100) — the number of records in the system log. Next follow n events from the system journal in the order in which the were made. Each event was written on a single line and looks as "+ ri" or "- ri", where ri is an integer from 1 to 106, the registration number of the visitor (that is, distinct visitors always have distinct registration numbers).

It is guaranteed that the log is not contradictory, that is, for every visitor the types of any of his two consecutive events are distinct. Before starting the system, and after stopping the room may possibly contain visitors.

Output

Print a single integer — the minimum possible capacity of the reading room.

Examples

Input

6
+ 12001
- 12001
- 1
- 1200
+ 1
+ 7


Output

3

Input

2
- 1
- 2


Output

2

Input

2
+ 1
- 1


Output

1

Note

In the first sample test, the system log will ensure that at some point in the reading room were visitors with registration numbers 1, 1200 and 12001. More people were not in the room at the same time based on the log. Therefore, the answer to the test is 3.
import java.io.InputStream;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.InputMismatchException;
import java.util.NoSuchElementException;
import java.math.BigDecimal;
import java.math.BigInteger;
    
public class Main{
 
static PrintWriter out;
static InputReader ir;
static final int INF=Integer.MAX_VALUE;
static final long LINF=Long.MAX_VALUE;
 
static void solve(){
 int n=ir.nextInt();
 binarySearchTree tree=new binarySearchTree();
 int ma=0,now=0;
 for(int i=0;i<n;i++){
  char s=ir.next().charAt(0);
  int a=ir.nextInt();
  if(s=='+'){
   tree.insert(a);
   now++;
  }
  else{
   if(tree.find(a)){
    now--;
    tree.delete(a);
   }
   else{
    ma++;
   }
  }
  ma=Math.max(ma,now);
 }
 out.println(ma);
}

public static void main(String[] args) throws Exception{
 ir=new InputReader(System.in);
 out=new PrintWriter(System.out);
 solve();
 out.flush();
}

static class binarySearchTree{
   
 static class Node{
  long id;
  Node p;
  Node l;
  Node r;
  Node(long id){
   this.id=id; this.p=null; this.l=null; this.r=null;
  }
 }
   
 private static Node root;
   
 binarySearchTree(){
  root=null;
 }
   
 public static void insert(long v){
  if(root==null) root=new Node(v);
  else __insert(new Node(v));
 }
   
 private static void __insert(Node z){
  Node x=root;
  Node y=null;
  while(x!=null){
   y=x;
   if(z.id<x.id) x=x.l;
   else x=x.r;
  }
  z.p=y;
  if(z.id<y.id) y.l=z;
  else y.r=z;
 }
   
 public static boolean find(long v){
  Node x=root;
  while(x!=null){
   if(x.id==v) return true;
   else if(x.id>v) x=x.l;
   else x=x.r;
  }
  return false;
 }
 
 public static boolean delete(long v){
  Node x=root;
  Node y=null;
  boolean isLeftChild=true;
  while(true){
   if(x==null) return false;
   else if(x.id==v) break;
   y=x;
   if(v<x.id){
    x=x.l;
    isLeftChild=true;
   }
   else{
    x=x.r;
    isLeftChild=false;
   }
  }
  if(x.l==null){
   if(x==root) root=x.r;
    else if(isLeftChild) y.l=x.r;
    else y.r=x.r;
   }
  else if(x.r==null){
   if(x==root) root=x.l;
   else if(isLeftChild) y.l=x.l;
   else y.r=x.l;
  }
  else{
   y=x;
   Node right=x.r;
   isLeftChild=false;
   while(right.l!=null){
    y=right;
    right=right.l;
    isLeftChild=true;
   }
   x.id=right.id;
   if(isLeftChild) y.l=right.r;
   else y.r=right.r;
  }
  return true;
 }
 
 public static void print(){
  inorder(root);
  out.println();
  preorder(root);
  out.println();
 }
   
 private static void preorder(Node now){
  if(now==null) return;
  out.print(" "+now.id);
  preorder(now.l);
  preorder(now.r);
 }
    
 private static void inorder(Node now){
  if(now==null) return;
  inorder(now.l);
  out.print(" "+now.id);
  inorder(now.r);
 }
    
 private static void postorder(Node now){
  if(now==null) return;
  postorder(now.l);
  postorder(now.r);
  out.print(" "+now.id);
 }
}

static class InputReader {
 private InputStream in;
 private byte[] buffer=new byte[1024];
 private int curbuf;
 private int lenbuf;

 public InputReader(InputStream in) {this.in=in; this.curbuf=this.lenbuf=0;}
 
 public boolean hasNextByte() {
  if(curbuf>=lenbuf){
   curbuf= 0;
   try{
    lenbuf=in.read(buffer);
   }catch(IOException e) {
    throw new InputMismatchException();
   }
   if(lenbuf<=0) return false;
  }
  return true;
 }

 private int readByte(){if(hasNextByte()) return buffer[curbuf++]; else return -1;}
 
 private boolean isSpaceChar(int c){return !(c>=33&&c<=126);}
 
 private void skip(){while(hasNextByte()&&isSpaceChar(buffer[curbuf])) curbuf++;}
 
 public boolean hasNext(){skip(); return hasNextByte();}
 
 public String next(){
  if(!hasNext()) throw new NoSuchElementException();
  StringBuilder sb=new StringBuilder();
  int b=readByte();
  while(!isSpaceChar(b)){
   sb.appendCodePoint(b);
   b=readByte();
  }
  return sb.toString();
 }
 
 public int nextInt() {
  if(!hasNext()) throw new NoSuchElementException();
  int c=readByte();
  while (isSpaceChar(c)) c=readByte();
  boolean minus=false;
  if (c=='-') {
   minus=true;
   c=readByte();
  }
  int res=0;
  do{
   if(c<'0'||c>'9') throw new InputMismatchException();
   res=res*10+c-'0';
   c=readByte();
  }while(!isSpaceChar(c));
  return (minus)?-res:res;
 }
 
 public long nextLong() {
  if(!hasNext()) throw new NoSuchElementException();
  int c=readByte();
  while (isSpaceChar(c)) c=readByte();
  boolean minus=false;
  if (c=='-') {
   minus=true;
   c=readByte();
  }
  long res = 0;
  do{
   if(c<'0'||c>'9') throw new InputMismatchException();
   res=res*10+c-'0';
   c=readByte();
  }while(!isSpaceChar(c));
  return (minus)?-res:res;
 }

 public double nextDouble(){return Double.parseDouble(next());}

 public BigInteger nextBigInteger(){return new BigInteger(next());}

 public BigDecimal nextBigDecimal(){return new BigDecimal(next());}

 public int[] nextIntArray(int n){
  int[] a=new int[n];
  for(int i=0;i<n;i++) a[i]=nextInt();
  return a;
 }

 public long[] nextLongArray(int n){
  long[] a=new long[n];
  for(int i=0;i<n;i++) a[i]=nextLong();
  return a;
 }

 public char[][] nextCharMap(int n,int m){
  char[][] map=new char[n][m];
  for(int i=0;i<n;i++) map[i]=next().toCharArray();
  return map;
 }
}
}