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.lang.reflect.Array;
        import java.util.Scanner;
        import java.io.*;
        import java.util.*;
        import java.math.*;
        import java.lang.*;
        import static java.lang.Math.*;
        public class main implements Runnable {

            static ArrayList<Integer> adj[];
            static int co = 0, f = 0;

            static void Check2(int n) {
                adj = new ArrayList[n + 1];
                for (int i = 0; i <= n; i++) {
                    adj[i] = new ArrayList<>();
                }

            }

            static void add(int i, int j) {

                adj[i].add(j);
                adj[j].add(i);
            }

            public static void main(String[] args) {
                new Thread(null, new main(), "Check2", 1 << 26).start();// to increse stack size in java
            }

            static long mod = (long) (1e9 + 7);

            public void run() {
                /* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */
                //Scanner in=new Scanner(System.in);

                InputReader in = new InputReader(System.in);
                PrintWriter w = new PrintWriter(System.out);



                int co=0;
                int max=0;
                int to=0;
                    int t=in.nextInt();
                    int v[]=new int[1000001];
                    while (t-->0){



                        char c=in.next().charAt(0);
                        int a=in.nextInt();
                        if(v[a]==0&&c=='+'){
                            v[a]=1;
                            co++;

                        }
                        else if(v[a]==1&&c=='-'){
                            v[a]=0;
                            co--;

                        }
                        else if(v[a]==0&&c=='-'){
                       max++;

                        }






                    max=max(max,co);
                    }
                    w.println(max);


                w.close();
            }

            static class pair   {


                String pid,cid,sid,rid;

                pair(String a,String b,String c,String d){
                    pid=a;
                    cid=b;
                    sid=c;
                    rid=d;
                }






            }


            static long power(long x,long y){
                if(y==0)return 1%mod;
                if(y==1)return x%mod;


                long res=1;
                x=x%mod;
                while(y>0){


                    if((y%2)!=0){
                        res=(res*x)%mod;
                    }


                    y=y/2;
                    x=(x*x)%mod;
                }


                return res;



            }


            static  int gcd(int a,int b){

                if(b==0)return a;
                return gcd(b,a%b);
            }

            static  void sev(int a[],int n){

                for(int i=2;i<=n;i++)a[i]=i;
                for(int i=2;i<=n;i++){

                    if(a[i]!=0){
                        for(int j=2*i;j<=n;){

                            a[j]=0;
                            j=j+i;
                        }
                    }

                }

            }


            static class node{

                int y;
                int val;

                node(int a,int b){

                    y=a;
                    val=b;

                }


            }

            static class InputReader
            {
                private InputStream stream;
                private byte[] buf = new byte[1024];
                private int curChar;
                private int numChars;
                private SpaceCharFilter filter;

                public InputReader(InputStream stream)
                {
                    this.stream = stream;
                }

                public int read()
                {
                    if (numChars==-1)
                        throw new InputMismatchException();

                    if (curChar >= numChars)
                    {
                        curChar = 0;
                        try
                        {
                            numChars = stream.read(buf);
                        }
                        catch (IOException e)
                        {
                            throw new InputMismatchException();
                        }

                        if(numChars <= 0)
                            return -1;
                    }
                    return buf[curChar++];
                }

                public String nextLine()
                {
                    BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
                    String str = "";
                    try
                    {
                        str = br.readLine();
                    }
                    catch (IOException e)
                    {
                        e.printStackTrace();
                    }
                    return str;
                }
                public int nextInt()
                {
                    int c = read();

                    while(isSpaceChar(c))
                        c = read();

                    int sgn = 1;

                    if (c == '-')
                    {
                        sgn = -1;
                        c = read();
                    }

                    int res = 0;
                    do
                    {
                        if(c<'0'||c>'9')
                            throw new InputMismatchException();
                        res *= 10;
                        res += c - '0';
                        c = read();
                    }
                    while (!isSpaceChar(c));

                    return res * sgn;
                }

                public long nextLong()
                {
                    int c = read();
                    while (isSpaceChar(c))
                        c = read();
                    int sgn = 1;
                    if (c == '-')
                    {
                        sgn = -1;
                        c = read();
                    }
                    long res = 0;

                    do
                    {
                        if (c < '0' || c > '9')
                            throw new InputMismatchException();
                        res *= 10;
                        res += c - '0';
                        c = read();
                    }
                    while (!isSpaceChar(c));
                    return res * sgn;
                }

                public double nextDouble()
                {
                    int c = read();
                    while (isSpaceChar(c))
                        c = read();
                    int sgn = 1;
                    if (c == '-')
                    {
                        sgn = -1;
                        c = read();
                    }
                    double res = 0;
                    while (!isSpaceChar(c) && c != '.')
                    {
                        if (c == 'e' || c == 'E')
                            return res * Math.pow(10, nextInt());
                        if (c < '0' || c > '9')
                            throw new InputMismatchException();
                        res *= 10;
                        res += c - '0';
                        c = read();
                    }
                    if (c == '.')
                    {
                        c = read();
                        double m = 1;
                        while (!isSpaceChar(c))
                        {
                            if (c == 'e' || c == 'E')
                                return res * Math.pow(10, nextInt());
                            if (c < '0' || c > '9')
                                throw new InputMismatchException();
                            m /= 10;
                            res += (c - '0') * m;
                            c = read();
                        }
                    }
                    return res * sgn;
                }

                public String readString()
                {
                    int c = read();
                    while (isSpaceChar(c))
                        c = read();
                    StringBuilder res = new StringBuilder();
                    do
                    {
                        res.appendCodePoint(c);
                        c = read();
                    }
                    while (!isSpaceChar(c));

                    return res.toString();
                }

                public boolean isSpaceChar(int c)
                {
                    if (filter != null)
                        return filter.isSpaceChar(c);
                    return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
                }

                public String next()
                {
                    return readString();
                }

                public interface SpaceCharFilter
                {
                    public boolean isSpaceChar(int ch);
                }
            }







        }
