stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#include <bits/stdc++.h>

#define ll long long

#define pb push_back

#define mp make_pair

int cnt[501];

bool was[501];

using namespace std;

int N;

bool can = true;

int a[250001];

int pos[500];

vector<pair<int , int> > g;

int main()

{

    memset(a , -1 , sizeof a);

    scanf("%d" , &N);

    for(int i = 1; i <= N; i++)

    {

        cnt[i] = 1;

        int x;

        scanf("%d" , &x);

        pos[i] = x;

        a[x] = i;

        g.pb(mp(x , i));

    }

    sort(g.begin() , g.end());

    for(int i = 0; i < g.size(); i++)

    {

        int curPos = g[i].first;

        int x = g[i].second;

        int cur = x;

        for(int i = 1; i < curPos; i++)

        {

            if(a[i] != -1)

                continue;

            if(cnt[cur] < cur)

            {

                a[i] = cur;

                cnt[cur]++;

            }

        }

        if(cnt[cur] != cur)

        {

            printf("No");

            return 0;

        }

    }

    for(int i = 1; i <= N; i++)

    {

        for(int j = pos[i] + 1; j <= N * N; j++)

        {

            if(a[j] != -1)

                continue;

            if(cnt[i] < N)

            {

                a[j] = i;

                cnt[i]++;

            }

        }

        if(cnt[i] < N)

        {

            printf("No");

            return 0;

        }

    }

    if(!can)

    {

        printf("No");

        return 0;

    }

    printf("Yes\n");

    for(int i = 1; i <= N * N; i++)

        printf("%d " , a[i]);

}


// Faster C++ solution for the same problem (measured speedup: 10.484159734366532x):
#include<cstdio>

#include<algorithm>

using namespace std;

#define MAXN 510

#define MAXM 250010

int a[MAXM],f[MAXN],x[MAXN],n,ls=1;

bool cmp(int a,int b)

{

	return x[a]<x[b];

}

int main()

{

	scanf("%d",&n);

	for(int i=1;i<=n;i++)

	{

		scanf("%d",&x[i]);

		a[x[i]]=i;

		f[i]=i;

	}

	sort(f+1,f+1+n,cmp);

	for(int i=1;i<=n;i++)

	{

		int k=f[i];

		for(int j=1;j<k;j++)

		{

			while(a[ls]) ls++;

			if(ls>x[k])

			{

				printf("No\n");

				return 0;

			}

			a[ls]=k;

		}

	}

	for(int i=1;i<=n;i++)

	{

		int k=f[i];

		for(int j=1;j<=n-k;j++)

		{

			while(a[ls]) ls++;

			if(ls<x[k]||ls>n*n)

			{

				printf("No\n");

				return 0;

			}

			a[ls]=k;

		}

	}

	printf("Yes\n");

	for(int i=1;i<=n*n;i++)

		printf("%d ",a[i]);

}
// Slower C++ solution:
#include <bits/stdc++.h>

#define ll long long

#define pb push_back

#define mp make_pair

int cnt[501];

bool was[501];

using namespace std;

int N;

bool can = true;

int a[250001];

int pos[500];

vector<pair<int , int> > g;

int main()

{

    memset(a , -1 , sizeof a);

    scanf("%d" , &N);

    for(int i = 1; i <= N; i++)

    {

        cnt[i] = 1;

        int x;

        scanf("%d" , &x);

        pos[i] = x;

        a[x] = i;

        g.pb(mp(x , i));

    }

    sort(g.begin() , g.end());

    for(int i = 0; i < g.size(); i++)

    {

        int curPos = g[i].first;

        int x = g[i].second;

        int cur = x;

        for(int i = 1; i < curPos; i++)

        {

            if(a[i] != -1)

                continue;

            if(cnt[cur] < cur)

            {

                a[i] = cur;

                cnt[cur]++;

            }

        }

        if(cnt[cur] != cur)

        {

            printf("No");

            return 0;

        }

    }

    for(int i = 1; i <= N; i++)

    {

        for(int j = pos[i] + 1; j <= N * N; j++)

        {

            if(a[j] != -1)

                continue;

            if(cnt[i] < N)

            {

                a[j] = i;

                cnt[i]++;

            }

        }

        if(cnt[i] < N)

        {

            printf("No");

            return 0;

        }

    }

    if(!can)

    {

        printf("No");

        return 0;

    }

    printf("Yes\n");

    for(int i = 1; i <= N * N; i++)

        printf("%d " , a[i]);

}


// Faster C++ solution for the same problem (measured speedup: 1.949819658729254x):
//By Don4ick 

//#define _GLIBCXX_DEBUG



#include <bits/stdc++.h>



typedef long long ll;

typedef long double ld;

typedef unsigned int ui;



#define forn(i, n) for (int i = 1; i <= n; i++)

#define pb push_back

#define all(x) x.begin(), x.end()

#define y1 qewr1234



const double PI = acos(-1.0);

const int DIR = 4;

const int X[] = {1, 0, -1, 0};

const int Y[] = {0, 1, 0, -1};



const int N = 505;



using namespace std;



int n, ans[N * N];

pair < int, int > a[N];



int main()

{

	ios_base::sync_with_stdio(false);

	cin.tie();

	cout.tie();		



	//freopen(".in", "r", stdin);

	//freopen(".out", "w", stdout);



	//~read

	cin >> n;

	forn(i, n)	

	{

		cin >> a[i].first;

		a[i].second = i;

	}

	//~sort

	sort(a + 1, a + n + 1);

	set < int > st;

	forn(i, n * n)	

		st.insert(i);

	forn(i, n)

	{

		ans[a[i].first] = a[i].second;

		st.erase(a[i].first);

		forn(j, a[i].second - 1)

		{

			int x = *st.begin();

			if (x > a[i].first)

			{

				cout << "No" << endl;

				return 0;

			}

			ans[x] = a[i].second;

			st.erase(x);

		}

	}

	for (int i = 1; i <= n; i++)

	{

		for (int j = a[i].second + 1; j <= n; j++)

		{

			int x = *st.begin();

			if (x < a[i].first)

            {

            	cout << "No" << endl;

            	return 0;

            }

            ans[x] = a[i].second;

            st.erase(x);

		}

	}

	cout << "Yes" << endl;

	forn(i, n * n)

		cout << ans[i] << ' ';

	return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

#define ll long long

#define pb push_back

#define mp make_pair

int cnt[501];

bool was[501];

using namespace std;

int N;

bool can = true;

int a[250001];

int pos[500];

vector<pair<int , int> > g;

int main()

{

    memset(a , -1 , sizeof a);

    scanf("%d" , &N);

    for(int i = 1; i <= N; i++)

    {

        cnt[i] = 1;

        int x;

        scanf("%d" , &x);

        pos[i] = x;

        a[x] = i;

        g.pb(mp(x , i));

    }

    sort(g.begin() , g.end());

    for(int i = 0; i < g.size(); i++)

    {

        int curPos = g[i].first;

        int x = g[i].second;

        int cur = x;

        for(int i = 1; i < curPos; i++)

        {

            if(a[i] != -1)

                continue;

            if(cnt[cur] < cur)

            {

                a[i] = cur;

                cnt[cur]++;

            }

        }

        if(cnt[cur] != cur)

        {

            printf("No");

            return 0;

        }

    }

    for(int i = 1; i <= N; i++)

    {

        for(int j = pos[i] + 1; j <= N * N; j++)

        {

            if(a[j] != -1)

                continue;

            if(cnt[i] < N)

            {

                a[j] = i;

                cnt[i]++;

            }

        }

        if(cnt[i] < N)

        {

            printf("No");

            return 0;

        }

    }

    if(!can)

    {

        printf("No");

        return 0;

    }

    printf("Yes\n");

    for(int i = 1; i <= N * N; i++)

        printf("%d " , a[i]);

}


// Faster C++ solution for the same problem (measured speedup: 2.032009724931101x):
#include<bits/stdc++.h>

#define rep(i,a,b) for(int i=(a);i<=(b);i++)

#define per(i,a,b) for(int i=(a);i>=(b);i--)

#define REP(i,n) for(int i=0;i<(n);i++)

#define qwq(x) cerr<<" #"<<#x<<" = "<<x<<endl;

#define fi first

#define se second

#define pb push_back

#define mp make_pair

using namespace std;

typedef pair<int,int> pii;

typedef vector<int> vi;

typedef long long ll;

 

template<class T> inline void read(T &x){

	int f=0;x=0;char ch=getchar();

	for(;!isdigit(ch);ch=getchar())f|=(ch=='-');

	for(;isdigit(ch);ch=getchar())x=x*10+ch-'0';

	if(f)x=-x;

}



const int N=1000005;

int ans[N],c[N],f[N];

pii p[N];

int n,x;



int main(){

	read(n);

	rep(i,1,n){

		read(x);

		f[x]=i;

		c[i]=i-1;

		p[i]=mp(x,i);

	}

	sort(p+1,p+n+1);

	rep(i,1,n*n)

		if(!f[i]){

			int t=lower_bound(p+1,p+n+1,mp(i,0))-p;

			int k=0;

			rep(j,t,n)

				if(c[p[j].se]){

					k=p[j].se;break;

				}

			if(!k)rep(j,1,n)if(c[j]){

				k=j;break;

			}

			if(!k){

				puts("No");

				return 0;

			}

			ans[i]=k;

			c[k]--;

		}

		else{

			if(c[f[i]]){

				puts("No");

				return 0;

			}

			ans[i]=f[i];

			c[f[i]]=n-f[i];

		}

	puts("Yes");

	rep(i,1,n*n)printf("%d ",ans[i]);

	puts("");

	return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std ;

#define rep( i, s, t ) for( register int i = s; i <= t; ++ i )

#define re register

int gi() {

	char cc = getchar() ; int cn = 0, flus = 1 ;

	while( cc < '0' || cc > '9' ) {  if( cc == '-' ) flus = - flus ; cc = getchar() ; }

	while( cc >= '0' && cc <= '9' )  cn = cn * 10 + cc - '0', cc = getchar() ;

	return cn * flus ;

}

const int N = 500 + 5 ;

int n, a[N], b[N * N], Id[N] ; 

bool cmp( int x, int y ) {

	return a[x] < a[y] ;

}

signed main()

{

	n = gi() ;

	rep( i, 1, n ) a[i] = gi(), Id[i] = i ;

	sort( Id + 1, Id + n + 1, cmp ) ;

	rep( i, 1, n ) if( a[Id[i]] == a[Id[i - 1]] ) {

		puts("No") ; exit(0) ;

	}

	int cnt = 0 ;

	rep( i, 1, n ) {

		int u = Id[i] - 1 ; 

		rep( j, 1, u ) {

			while( b[cnt + 1] ) ++ cnt ;

			b[++ cnt] = Id[i] ; 

		} 

		while( b[cnt + 1] ) ++ cnt ;

		if( cnt >= a[Id[i]] ) {

			puts("No") ; exit(0) ;

		}

		b[a[Id[i]]] = Id[i] ; 

		

	}

	rep( i, 1, n ) {

		int u = n - Id[i] ;

		while( b[cnt + 1] ) ++ cnt ; 

		if( cnt < a[Id[i]] ) {

			puts("No") ; exit(0) ; 

		}

		rep( j, 1, u ) {

			while( b[cnt + 1] ) ++ cnt ; 

			b[++ cnt] = Id[i] ;

		}

	}

	printf("Yes\n") ;

	rep( i, 1, n * n ) printf("%d ", b[i] ) ;

	return 0 ;

}

// Faster C++ solution for the same problem (measured speedup: 5.215440695475404x):
#include <stdio.h>

#include <algorithm>

#define N 500

using namespace std;



int a[N + 5], p[N + 5], b[N * N + 5] = {0};



void write(int x)

{

	if(x < 10){

		putchar(x + 48);

		return;

	}

	write(x / 10);

	putchar(x % 10 + 48);

}



int cmp(int x, int y)

{

	return a[x] < a[y];

}



int next(int i)

{

	for(i++; b[i]; i++);

	return i;

}



int main()

{		

	int n, i, head = 1, j, x, t;

	

	scanf("%d", &n);

	for(i = 1; i <= n; i++){

		scanf("%d", a + i);

		p[i] = i;

	}

	sort(p + 1, p + n + 1, cmp);

	

	for(i = 1; i <= n; i++){

		x = p[i], t = a[x];

		for(j = 1; j < x; j++){

			if(head >= t){

				puts("No");

				return 0;

			}

			b[head] = x;

			head = next(head);

		}

		if(head == t) head = next(head);

		b[t] = x;

	}

	for(i = 1; i <= n; i++){

		x = p[i], t = a[x];

		for(j = x + 1; j <= n; j++){

			if(head > t) b[head] = x;

			else{

				puts("No");

				return 0;

			}

			head = next(head);

		}

	}

	puts("Yes");

	write(b[1]);

	for(i = 2, t = n * n; i <= t; i++){

		putchar(32), write(b[i]);

	}

	puts("");

			

	return 0;

}
// Slower C++ solution:
#include <iostream>

#include <cstdio>

#include <algorithm>

#include <cstring>

#include <cmath>

#include <cstdlib>

#define ll long long

#define rep(i, a, b) for(int i = (a); i <= (b); i++)

#define per(i, b, a) for(int i = (b); i >= (a); i--)

using namespace std;

const int N = 505, M = 250005;

int n, sum, b[N], ans[M], ssum[N];

struct node{

    int pl, num;

}a[N];

bool cmp(node x, node y){

    return x.num == y.num ? x.pl < y.pl : x.num < y.num;

}

int main(){

    scanf("%d", &n);

    rep(i, 1, n){

        scanf("%d", &b[i]);

        a[i].pl = i, a[i].num = b[i];

    }

    sort(a + 1, a + n + 1, cmp);

    rep(i, 1, n){

        sum += a[i].pl;

        if(a[i].num < sum || a[i].num == a[i-1].num) {

            printf("No\n");

            return 0;

        }

    }

    sum = 0;

    per(i, n, 1){

        sum += n - a[i].pl + 1;

        if(n * n - a[i].num + 1 < sum) {

            printf("No\n");

            return 0;

        } 

    }

    rep(i, 1, n){

        int num = a[i].pl - 1;

        ans[a[i].num] = a[i].pl, ssum[a[i].pl]++;

        rep(j, 1, a[i].num - 1) {

            if(!num) break;

            if(!ans[j]) ans[j] = a[i].pl, num--, ssum[a[i].pl]++;

        }

    }

    rep(i, 1, n) rep(j, b[i] + 1, n * n) {

        if(ssum[i] == n) break;

        if(!ans[j]) ans[j] = i, ssum[i]++;

    }

    printf("Yes\n");

    rep(i, 1, n * n) printf("%d ", ans[i]);

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.174389062131216x):
#include<cstdio>

#include<cstring>

#include<algorithm>

using namespace std;

#define N 505

int pos[N],id[N],ans[N*N];

bool cmp(int x,int y){return pos[x]<pos[y];}

int main()

{

	int n,i,j,k,x;

	scanf("%d",&n);

	for(i=1;i<=n;i++){

		scanf("%d",&pos[i]);

		id[i]=i;ans[pos[i]]=i;

	}

	sort(id+1,id+n+1,cmp);

	k=1;

	for(i=1;i<=n;i++){

		x=id[i];

		for(j=1;j<x;j++){

			while(ans[k])k++;

			if(k>pos[x]){printf("No\n");return 0;}

			ans[k]=x;

		}

	}

	for(i=1;i<=n;i++){

		x=id[i];

		for(j=x+1;j<=n;j++){

			while(ans[k])k++;

			if(k<pos[x]){printf("No\n");return 0;}

			ans[k]=x;

		}

	}

	printf("Yes\n%d",ans[1]);

	for(i=2;i<=n*n;i++)

		printf(" %d",ans[i]);

}
// Slower C++ solution:
#include <iostream>

#include <cstdio>

#include <cstdlib>

#include <cstring>

#include <algorithm>

#include <cmath>

#include <queue>

#define FUP(i,x,y) for(int i=(x);i<=(y);i++)

#define FDW(i,x,y) for(int i=(x);i>=(y);i--)

#define MAXN 510

#define INF 0x3f3f3f3f

#define MOD 1000000007

#define ll long long

#define db double

using namespace std;

int read(){

    int w=0,flg=1;

    char ch=getchar();

    while(ch<'0'||ch>'9'){if(ch=='-')flg=-1;ch=getchar();}

    while(ch<='9'&&ch>='0'){w=w*10-'0'+ch,ch=getchar();}

    return w*flg;

}

struct node{

	int pos,data;

}b[MAXN];

bool cmp(node p,node q)

{

	return p.pos<q.pos;

}

int n,x[MAXN];

int a[MAXN*MAXN],need[MAXN*MAXN],now[MAXN*MAXN];

int num[MAXN*2],used[MAXN*2],cnt=1;

int main(){

	n=read();

	FUP(i,1,n)

	{

		x[i]=b[i].pos=read();

		b[i].data=i;

		a[x[i]]=i;

		need[x[i]]=i-1;

	}

	sort(b+1,b+n+1,cmp);

	FUP(i,1,n) num[i]=b[i].pos,used[i]=b[i].data-1;

	FUP(i,n+1,2*n) num[i]=b[i-n].pos,used[i]=n-1-used[i-n];

	FUP(i,1,n*n)

	{

		if(a[i])

		{

			if(need[i]!=now[i])

			{

				puts("No");

				return 0;

			}

		}

		else

		{

			while(used[cnt]==0) cnt++;

			used[cnt]--;

			a[i]=a[num[cnt]];

			now[num[cnt]]++;

		}

	}

	puts("Yes");

	FUP(i,1,n*n) printf("%d ",a[i]);

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.160575893145489x):
#include<cstdio>

#include<cstring>

#include<algorithm>

using namespace std;

#define N 505

int pos[N],id[N],ans[N*N];

bool cmp(int x,int y){return pos[x]<pos[y];}

int main()

{

	int n,i,j,k,x;

	scanf("%d",&n);

	for(i=1;i<=n;i++){

		scanf("%d",&pos[i]);

		id[i]=i;ans[pos[i]]=i;

	}

	sort(id+1,id+n+1,cmp);

	k=1;

	for(i=1;i<=n;i++){

		x=id[i];

		for(j=1;j<x;j++){

			while(ans[k])k++;

			if(k>pos[x]){printf("No\n");return 0;}

			ans[k]=x;

		}

	}

	for(i=1;i<=n;i++){

		x=id[i];

		for(j=x+1;j<=n;j++){

			while(ans[k])k++;

			if(k<pos[x]){printf("No\n");return 0;}

			ans[k]=x;

		}

	}

	printf("Yes\n%d",ans[1]);

	for(i=2;i<=n*n;i++)

		printf(" %d",ans[i]);

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

#define maxn 250010

template <typename T>inline T read()

{

    register T sum=0;

    register char cc=getchar();

    int sym=1;

    while(cc!='-'&&(cc>'9'||cc<'0'))cc=getchar();

    if(cc=='-')sym=-1,cc=getchar();

    sum=sum*10+cc-'0';

    cc=getchar();

    while(cc>='0'&&cc<='9')sum=sum*10+cc-'0',cc=getchar();

    return sym*sum;

}

template <typename T>inline T read(T &a)

{

    a=read<T>();

    return a;

}

template <typename T,typename... Others> inline void read(T& a, Others&... b)

{

    a=read(a);

	read(b...);

}

int n,m,a[maxn],cnt[maxn],ans[maxn],pos[maxn];

int main()

{

	read(n);

	m=n*n;

	for(int i=1;i<=n;i++)

	{

		read(a[i]);

		if(ans[a[i]])

		{

			puts("No");

			return 0;

		}

		cnt[a[i]]=i;

		ans[a[i]]=i;

		pos[a[i]]=i;

	}

	for(int i=1;i<=m;i++)

	{

		cnt[i]+=cnt[i-1];

		if(cnt[i]>i)

		{

			puts("No");

			return 0;

		}

	}

	int p=1;

	for(int i=1;i<=m;i++)

	{

		if(pos[i])

		{

			for(int s=ans[i]-1;s;s--)

			{

				while(ans[p])

					p+=1;

				if(p>i)

				{

					puts("No");

					return 0;

				}

				ans[p]=ans[i];

			}

		}

	}

	p=m;

	for(int i=m;i>=1;i--)

	{

		if(pos[i])

		{

			for(int s=n-ans[i];s;s--)

			{

				while(ans[p])

					p-=1;

				if(p<i)

				{

					puts("No");

					return 0;

				}

				ans[p]=ans[i];

			}

		}

	}

	puts("Yes");

	for(int i=1;i<=m;i++)

		printf("%d ",ans[i]);

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.155262323287709x):
#include<cstdio>

#include<cstring>

#include<algorithm>

using namespace std;

#define N 505

int pos[N],id[N],ans[N*N];

bool cmp(int x,int y){return pos[x]<pos[y];}

int main()

{

	int n,i,j,k,x;

	scanf("%d",&n);

	for(i=1;i<=n;i++){

		scanf("%d",&pos[i]);

		id[i]=i;ans[pos[i]]=i;

	}

	sort(id+1,id+n+1,cmp);

	k=1;

	for(i=1;i<=n;i++){

		x=id[i];

		for(j=1;j<x;j++){

			while(ans[k])k++;

			if(k>pos[x]){printf("No\n");return 0;}

			ans[k]=x;

		}

	}

	for(i=1;i<=n;i++){

		x=id[i];

		for(j=x+1;j<=n;j++){

			while(ans[k])k++;

			if(k<pos[x]){printf("No\n");return 0;}

			ans[k]=x;

		}

	}

	printf("Yes\n%d",ans[1]);

	for(i=2;i<=n*n;i++)

		printf(" %d",ans[i]);

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

 string S[200001];

int main()

{

    map <string,int> mp;



    int i, cnt = 0, n;

    cin >> n;

    for(i = 0; i < n; i++)

    {

        cin >> S[i];

        mp[S[i]]++;

    }

    for(i = 0; i < n; i++)

    {

        if(mp[S[i]] != 0)

        {

            cnt++;

            mp[S[i]] = 0;

        }

    }

    cout << cnt << endl;



}


// Faster C++ solution for the same problem (measured speedup: 8.220656864237409x):
#include <bits/stdc++.h>

 

using namespace std;

 

#define ll long long 



int main() {

    set<string> st;

    int n;

    cin>>n;

    string s;

    while(n--){

        cin>>s;

        st.insert(s);

    }

    cout<<st.size()<<endl;

    return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

 string S[200001];

int main()

{

    map <string,int> mp;



    int i, cnt = 0, n;

    cin >> n;

    for(i = 0; i < n; i++)

    {

        cin >> S[i];

        mp[S[i]]++;

    }

    for(i = 0; i < n; i++)

    {

        if(mp[S[i]] != 0)

        {

            cnt++;

            mp[S[i]] = 0;

        }

    }

    cout << cnt << endl;



}


// Faster C++ solution for the same problem (measured speedup: 8.238507978644979x):
#include <iostream>

#include <set>

using namespace std;

int main() {

    set<string> dd;

    int n;

    cin>>n;

    string ss;

    while(n--){

    	cin>>ss;

    	dd.insert(ss);

    }cout<<dd.size();

    return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

 string S[200001];

int main()

{

    map <string,int> mp;



    int i, cnt = 0, n;

    cin >> n;

    for(i = 0; i < n; i++)

    {

        cin >> S[i];

        mp[S[i]]++;

    }

    for(i = 0; i < n; i++)

    {

        if(mp[S[i]] != 0)

        {

            cnt++;

            mp[S[i]] = 0;

        }

    }

    cout << cnt << endl;



}


// Faster C++ solution for the same problem (measured speedup: 8.213035902444123x):
#include<bits/stdc++.h>

typedef long long ll;

using namespace std;

map<string,int> x;

int main()

{

	ll n,sum=0;

	string a;

	cin >> n;

	while(n--){

		cin >> a;

		if(x[a]==0){

			sum++;

			x[a]++;

		}

	}

	cout << sum << endl;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

 string S[200001];

int main()

{

    map <string,int> mp;



    int i, cnt = 0, n;

    cin >> n;

    for(i = 0; i < n; i++)

    {

        cin >> S[i];

        mp[S[i]]++;

    }

    for(i = 0; i < n; i++)

    {

        if(mp[S[i]] != 0)

        {

            cnt++;

            mp[S[i]] = 0;

        }

    }

    cout << cnt << endl;



}


// Faster C++ solution for the same problem (measured speedup: 8.102726875891767x):
#include<bits/stdc++.h>

using namespace std;

#define f(x,y,z) for(int x=y;x<z;++x)

typedef long long ll;

int n, h;

string s;

map<string,bool> m;

int main() {

    ios_base::sync_with_stdio(false);cin.tie(0);

    cin >> n;

    while(n--) {

        cin >> s;

        if(!m[s]) ++h, m[s] = true;

    }

    cout << h << '\n';

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

string s[200005];

int main()

{

    ios::sync_with_stdio(false);

    int n;

    cin>>n;

    for(int i=0;i<n;i++)

    {

        cin>>s[i];

    }

    sort(s,s+n);

    string s1="";

    long long ans=0;

    for(int i=0;i<n;i++)

    {

        if(s1!=s[i])

        {

            ans++;

            s1=s[i];

        }

    }

    cout<<ans;

}


// Faster C++ solution for the same problem (measured speedup: 8.224601558761405x):
#include<iostream>

#include<cstdio>

#include<algorithm>

#include<cstring>

#include<cstdlib>

#include<vector>

#include<map>

#include<cmath>

#define ll long long

#define inf 0x7fffffff;

#define maxn 1005

using namespace std;

int n;

map<string,int> m; 

int read()

{

    int l=0,w=1;

    char ch=getchar();

    while(ch<'0'||ch>'9')

    {

        if(ch=='-')

        w=-1;

        else

        ch=getchar();

    }

    while(ch<='9'&&ch>='0')

    {

        l*=10;

        l+=ch-'0';

        ch=getchar();

    }

    return l*w;

} 



int main()

{

	n=read();

	for(int i=1;i<=n;i++)

	{

		string s;

		cin>>s;

		m[s]=1;

	}

	cout<<m.size()<<endl;

	return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

string s[200005];

int main()

{

    ios::sync_with_stdio(false);

    int n;

    cin>>n;

    for(int i=0;i<n;i++)

    {

        cin>>s[i];

    }

    sort(s,s+n);

    string s1="";

    long long ans=0;

    for(int i=0;i<n;i++)

    {

        if(s1!=s[i])

        {

            ans++;

            s1=s[i];

        }

    }

    cout<<ans;

}


// Faster C++ solution for the same problem (measured speedup: 8.252171740809004x):
#include<bits/stdc++.h>

using namespace std;

set<string>s;

int main(){

	int n;

	cin>>n;

	while(n--){

		string s1;

		cin>>s1;

		s.insert(s1);

	}

	cout<<s.size();

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

string s[200005];

int main()

{

    ios::sync_with_stdio(false);

    int n;

    cin>>n;

    for(int i=0;i<n;i++)

    {

        cin>>s[i];

    }

    sort(s,s+n);

    string s1="";

    long long ans=0;

    for(int i=0;i<n;i++)

    {

        if(s1!=s[i])

        {

            ans++;

            s1=s[i];

        }

    }

    cout<<ans;

}


// Faster C++ solution for the same problem (measured speedup: 8.134516863574524x):
#include <bits/stdc++.h>



using namespace std;



int main(){

	ios::sync_with_stdio(false);

	cin.tie(0);

	int n;

	cin >> n;

	set <string> s;

	while (n--){

		string t;

		cin >> t;

		s.insert(t);

	}

	cout << s.size() << '\n';

	return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

string s[200005];

int main()

{

    ios::sync_with_stdio(false);

    int n;

    cin>>n;

    for(int i=0;i<n;i++)

    {

        cin>>s[i];

    }

    sort(s,s+n);

    string s1="";

    long long ans=0;

    for(int i=0;i<n;i++)

    {

        if(s1!=s[i])

        {

            ans++;

            s1=s[i];

        }

    }

    cout<<ans;

}


// Faster C++ solution for the same problem (measured speedup: 8.234368991225667x):
#include <iostream>

#include <string>

#include <set>



using namespace std;



int main() {

	int n = 0;

	cin >> n;



	string str;

	set<string> s;



	for (int i = 0; i < n; i++) {

		cin >> str;

		s.insert(str);

	}



	cout << s.size() << endl;



	//system("PAUSE");

	return 0;

}