For a set $S$ of integers, perform a sequence of the following operations. Note that each value in $S$ must be unique.

* insert($x$): Insert $x$ to $S$ and report the number of elements in $S$ after the operation.
* find($x$): Report the number of $x$ in $S$ (0 or 1).
* delete($x$): Delete $x$ from $S$.

Constraints

* $1 \leq q \leq 200,000$
* $0 \leq x \leq 1,000,000,000$

Input

The input is given in the following format.


$q$
$query_1$
$query_2$
:
$query_q$


Each query $query_i$ is given by


0 $x$


or


1 $x$


or


2 $x$


where the first digits 0, 1 and 2 represent insert, find and delete operations respectively.

Output

For each insert operation, print the number of elements in $S$.
For each find operation, print the number of specified elements in $S$.

Example

Input

8
0 1
0 2
0 3
2 2
1 1
1 2
1 3
0 2


Output

1
2
3
1
0
1
3
#include <iostream>
using namespace std;


unsigned long int nxt = 1;

int getrand(int RANGE=1000000007)
{
    nxt = nxt*1103515245+12345;
    return (nxt) % RANGE;
}

void Srand(unsigned long int seed)
{
    nxt = seed;
}

class Treap
{
    typedef struct _Node
    {
        int x,y,cnt;
        _Node *l,*r;
        _Node(int _x) : x(_x),y(getrand()),cnt(1),l(NULL),r(NULL) {}
        ~_Node()
        {
            delete l;
            delete r;
        }
        void recalc()
        {
            cnt = 1;
            if(l)
                cnt+=l->cnt;
            if(r)
                cnt+=r->cnt;
        }
    }
    *Node;
    Node merge(Node l,Node r)
    {
        if(!l || !r)
            return l?l:r;
        if(l->y < r->y)
        {
            l->r = merge(l->r,r);
            l->recalc();
            return l;
        }
        else
        {
            r->l = merge(l,r->l);
            r->recalc();
            return r;
        }
    }
    void split(Node v,int x,Node &l,Node &r)
    {
        l = r = NULL;
        if(!v)
            return;
        if(v->x < x)
        {
            split(v->r,x,v->r,r);
            l = v;
        }
        else
        {
            split(v->l,x,l,v->l);
            r = v;
        }
        v->recalc();
    }
    Node root;
public:
    Treap():root(NULL) {}
    ~Treap()
    {
        delete root;
    }
    bool search(Node v,int x)
    {
        if(!v) return 0;
        if(v->x == x) return 1;
        else if(v->x > x) return search(v->l,x);
        else return search(v->r,x);
    }
    bool search(int x)
    {
        return search(root,x);
    }
    void insert(int x)
    {
        if(search(x)) return;
        Node l,r;
        split(root,x,l,r);
        root = merge(merge(l,new _Node(x)),r);
    }

    void erase(int x)
    {
        Node l,m,r;
        split(root,x,l,m);
        split(m,x+1,m,r);
        //assert(m && m->cnt == 1 && m->x == x);
        delete m;
        root = merge(l,r);
    }
    void printTreap(Node v)
    {
        if(!v) return;
        printf("v : %d  p : %d  cnt : %d\n",v->x,v->y,v->cnt);
        printTreap(v->l);
        printTreap(v->r);
    }
    void printTreap()
    {
        printTreap(root);
    }
    void inorder(Node v)
    {
        if(!v) return;
        inorder(v->l);
        printf("%d ",v->x);
        inorder(v->r);
    }
    void inorder()
    {
        inorder(root);
    }
    /*
    int k_th_node(Node v,int k)
    {
        if()
    }
    int k_th_node(int k)
    {
        return k_th_node(root,k);
    }
    */
    int size() const
    {
        return root? root->cnt : 0;
    }
};

int main()
{
    Srand(2333333);
    Treap st;
    int q;
    scanf("%d",&q);
    while(q--)
    {
        int a,b;
        scanf("%d%d",&a,&b);
        if(a==0)
        {
            st.insert(b);
            printf("%d\n",st.size());
        }
        else if(a==1)
        {
            printf("%d\n",st.search(b));
        }
        else if(a==2)
        {
            st.erase(b);
        }
    }
    return 0;
}

