/*بسم الله الرحمن الرحيم*/
/*“Dengan menyebut nama Allah yang Maha Pengasih lagi Maha Penyayang”*/
/*“In the name of Allah, Most Gracious, Most Merciful”*/
/********************************************************************************************************\__
                                                                                |
        author  :   Althafa Dhia Syauqi   ||    email   :    daltafa@gmail.com                              ||
        SMAN 10 Samarinda, Kalimantan Timur.                                                    ||
                                                                                ||
/********************************************************************************************************/
#include <bits/stdc++.h>
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
#define rep_k(i,n) for(int x=i;x<n;x++)
#define rep(i,n) for(int i=0;i<(n);i++)
#define rep_n(i,n) for(int i=1;i<=(n);i++)
#define rep_all(k) for(auto x:k)
#define endl '\n'
#define mod 1e9+7
#define pb push_back
#define READ(f)         freopen(f, "r", stdin)
#define WRITE(f)        freopen(f, "w", stdout)
#define maxSort         sort(all(v),greater<int>())
#define rSort           sort(v.rbegin(),v.rend())
#define FOREACH(i,c) for (typeof((c).end()) i = (c).begin(); i != (c).end(); ++i)
#define RESET(c,v) memset(c, v, sizeof(c))
#define sqr(x)          ((x)*(x))
#define qube(x)         ((x)*(x)*(x))
using namespace std;
void optimization()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
}
string a;
bool checkPalindrome(string inputString) {
    if (inputString == string(inputString.rbegin(), inputString.rend())) {
        return true;
    }else{
        return false;
    }
}

ll t;
bool cek()
{
    ll temp=0;
    rep(i,a.length())
    {
        if(a[i]!=a[i-1])
            temp++;
    }
    if(temp!=1)
        return 0;
        else
            return 1;
}
int main()
{
	optimization();
	cin >> t;
	rep(i,t){
    cin >> a;
    if(checkPalindrome(a))
    {
        if(a.length()==2||a.length()==1||cek())
           cout<<"-1"<<endl;
            else
        {
            while(checkPalindrome(a))
                random_shuffle(a.begin(),a.end());
            cout <<a<<endl;
        }
    }else
    {
        cout << a<<endl;
    }}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

int palindrome(char* s){
    int n=strlen(s), pal=0;
    for(int i=0; i<n-n/2; i++){
        if(s[i]==s[n-i-1]) pal++;
        else{
            pal=0;
            break;
        }
    }
    if(pal) return 1;
    else return 0;
}

int sameletter(char* s){
    int i;
    for(i=1; i<strlen(s) && s[i]==s[0]; i++){
        if(s[i]!=s[0]){
            i=0;
            break;
        }
    }
    if(i==strlen(s)) return 1;
    else return 0;
}

int main(){
	char st[1001], tmp;
	int n, t, i, j, check;
	scanf("%d\n", &t);
	while(t--){
    	gets(st);
    	n=strlen(st);
    	check = palindrome(st);
    	if(check){
    	    if(sameletter(st)) printf("-1\n");
    	    else{
    	        while(palindrome(st)){
    	            i=n/2;
    	            if(n%2) j=i+1;
    	            else j=i+2;
    	            tmp=st[i];
    	            st[i]=st[j];
    	            st[j]=tmp;
    	            i--;
    	        }
    	        cout << st << endl;
    	    }
    	}
    	else cout << st << endl;
	}
}


#include <bits/stdc++.h>
using namespace std;

int palindrome(char* s){
    int n=strlen(s), pal=0;
    for(int i=0; i<n-n/2; i++){
        if(s[i]==s[n-i-1]) pal++;
        else{
            pal=0;
            break;
        }
    }
    if(pal) return 1;
    else return 0;
}

int sameletter(char* s){
    int i;
    for(i=1; i<strlen(s) && s[i]==s[0]; i++){
        if(s[i]!=s[0]){
            i=0;
            break;
        }
    }
    if(i==strlen(s)) return 1;
    else return 0;
}

int main(){
	char st[1001], tmp;
	int n, t, i, j, check;
	scanf("%d\n", &t);
	while(t--){
    	gets(st);
    	n=strlen(st);
    	check = palindrome(st);
    	if(check){
    	    if(sameletter(st)) printf("-1\n");
    	    else{
    	        while(palindrome(st) && i>0){
    	            i=n/2;
    	            if(n%2) j=i+1;
    	            else j=i+2;
    	            tmp=st[i];
    	            st[i]=st[j];
    	            st[j]=tmp;
    	            i--;
    	        }
    	        cout << st << endl;
    	    }
    	}
    	else cout << st << endl;
	}
}


#include <bits/stdc++.h>
using namespace std;

int palindrome(char* s){
    int n=strlen(s), pal=0;
    for(int i=0; i<n-n/2; i++){
        if(s[i]==s[n-i-1]) pal++;
        else{
            pal=0;
            break;
        }
    }
    if(pal) return 1;
    else return 0;
}

int sameletter(char* s){
    int i;
    for(i=1; i<strlen(s) && s[i]==s[0]; i++){
        if(s[i]!=s[0]){
            i=0;
            break;
        }
    }
    if(i==strlen(s)) return 1;
    else return 0;
}

int main(){
	char st[1001], tmp;
	int n, t, i, j, check;
	scanf("%d\n", &t);
	while(t--){
    	gets(st);
    	n=strlen(st);
    	int alphabet[27]={0};
    	if(sameletter(st)) printf("-1\n");
    	else{
    	    for(int k=0; k<n; k++){
    	        alphabet[st[k]-'a']++;
    	    }
    	    for(int k=0; k<27; k++){
    	        for(int l=0; l<alphabet[k]; l++){
    	           printf("%c", k+'a');
    	        }
    	    }
    	        cout << endl;
        }
	}
}


#include <bits/stdc++.h>
using namespace std;

int palindrome(char* s){
    int n=strlen(s), pal=0;
    for(int i=0; i<n-n/2; i++){
        if(s[i]==s[n-i-1]) pal++;
        else{
            pal=0;
            break;
        }
    }
    if(pal) return 1;
    else return 0;
}

int sameletter(char* s){
    int i;
    for(i=1; i<strlen(s) && s[i]==s[0]; i++){
        if(s[i]!=s[0]){
            i=0;
            break;
        }
    }
    if(i==strlen(s)) return 1;
    else return 0;
}

int main(){
	char st[1001], tmp;
	int n, t, i, j, check;
	scanf("%d\n", &t);
	while(t--){
    	gets(st);
    	n=strlen(st);
    	check = palindrome(st);
    	if(check){
    	    if(sameletter(st)) printf("-1\n");
    	    else{
    	        while(palindrome(st)){
    	            i=n/2;
    	            if(n%2) j=i+1;
    	            else j=i+2;
    	            tmp=st[i];
    	            st[i]=st[j];
    	            st[j]=tmp;
    	        }
    	        cout << st << endl;
    	    }
    	}
    	else cout << st << endl;
	}
}


#include <bits/stdc++.h>
using namespace std;

int palindrome(char* s){
    int n=strlen(s), pal=0;
    for(int i=0; i<n-n/2; i++){
        if(s[i]==s[n-i-1]) pal++;
        else{
            pal=0;
            break;
        }
    }
    if(pal) return 1;
    else return 0;
}

int sameletter(char* s){
    int i;
    for(i=1; i<strlen(s) && s[i]==s[0]; i++){
        if(s[i]!=s[0]){
            i=0;
            break;
        }
    }
    if(i==strlen(s)) return 1;
    else return 0;
}

int main(){
	char st[1001], tmp;
	int n, t, i, j, check;
	scanf("%d\n", &t);
	while(t--){
    	gets(st);
    	n=strlen(st);
    	check = palindrome(st);
    	if(check){
    	    if(sameletter(st)) printf("-1\n");
    	    else{
    	        while(palindrome(st) && i>=0){
    	            i=n/2;
    	            if(n%2) j=i+1;
    	            else j=i+2;
    	            swap(st[i], st[j]);
    	            i--;
    	        }
    	        cout << st << endl;
    	    }
    	}
    	else cout << st << endl;
	}
}


#include <bits/stdc++.h>

using namespace std ;

const int N = 1e2 + 5;
const int INF = 1e9 ;

//+992 905 55 82 70 ;
// 90 900 62 82

int t ;
string s ;
set < char > S ;

int main(){

    cin >> t ;
    while ( t-- ){
        cin >> s ;
        for ( int i = 0 ; i < s.size() ; i++ ){
                S.insert(s[i]) ;
        }
        if ( S.size() == 1 ){
                cout << -1 << "\n";
                continue ;
        }
        if ( S.size() == 2 ){
                for ( int i = 0 ; i < s.size() ; i++ ){
                    if ( s[i] != s[i+1] ){
                            swap(s[i],s[s.size()-1]) ;
                            break ;
                    }
                }
        }
        else{
                for ( int i = 0 ; i < int(s.size()) - 1 ; i++ ){
                        swap(s[i],s[(s.size())-i-1]) ;
                        swap(s[i],s[i+1]) ;
                        swap(s[i],s[i+1]) ;
                }
        }
        cout << s << "\n";
    }

}


#include <bits/stdc++.h>

using namespace std ;

const int N = 1e2 + 5;
const int INF = 1e9 ;

//+992 905 55 82 70 ;
// 90 900 62 82

int t ;
string s ;
set < char > S ;

int main(){

    cin >> t ;
    while ( t-- ){
        cin >> s ;
        for ( int i = 0 ; i < s.size() ; i++ ){
                S.insert(s[i]) ;
        }
        if ( S.size() == 1 ){
                cout << -1 << "\n";
                continue ;
        }
        for ( int i = 0 ; i < int(s.size()) - 1 ; i++ ){
                swap(s[i],s[i+1]) ;
        }
        cout << s << "\n";
    }

}


#include <bits/stdc++.h>

using namespace std ;

const int N = 1e2 + 5;
const int INF = 1e9 ;

//+992 905 55 82 70 ;
// 90 900 62 82

int t ;
string s ;
set < char > S ;

int main(){

    cin >> t ;
    while ( t-- ){
        cin >> s ;
        for ( int i = 0 ; i < s.size() ; i++ ){
                S.insert(s[i]) ;
        }
        if ( S.size() == 1 ){
                cout << -1 << "\n";
                continue ;
        }
        sort ( s.begin() , s.end() ) ;
        reverse( s.begin() , s.end() ) ;
        cout << s << "\n";
    }

}


#include <bits/stdc++.h>

using namespace std ;

const int N = 1e2 + 5;
const int INF = 1e9 ;

//+992 905 55 82 70 ;
// 90 900 62 82

int t ;
string s ;
set < char > S ;

int main(){

    cin >> t ;
    while ( t-- ){
        cin >> s ;
        for ( int i = 0 ; i < s.size() ; i++ ){
                S.insert(s[i]) ;
        }
        if ( S.size() == 1 ){
                cout << -1 << "\n";
                continue ;
        }
        sort ( s.begin() , s.end() ) ;
        if ( s[1] == s[s.size()-1] ){
            cout << -1 ; continue ;
        }
        cout << s << "\n";
    }

}


#include <bits/stdc++.h>

using namespace std ;

const int N = 1e2 + 5;
const int INF = 1e9 ;

//+992 905 55 82 70 ;
// 90 900 62 82

int t ;
string s ;
set < char > S ;

int main(){

    cin >> t ;
    while ( t-- ){
        cin >> s ;
        for ( int i = 0 ; i < s.size() ; i++ ){
                S.insert(s[i]) ;
        }
        if ( S.size() == 1 ){
                cout << -1 << "\n";
                continue ;
        }
        if ( S.size() == 2 ){
                for ( int i = 0 ; i < s.size()-1 ; i++ ){
                    if ( s[i] != s[i+1] ){
                            swap(s[i+1],s[s.size()-1]) ;
                            break ;
                    }
                }
        }
        else{
                for ( int i = 1 ; i < int(s.size()) ; i++ ){
                        swap(s[i],s[i-1]) ;
                }
        }
        cout << s << "\n";
    }

}


#include <bits/stdc++.h>

using namespace std ;

const int N = 1e2 + 5;
const int INF = 1e9 ;

//+992 905 55 82 70 ;
// 90 900 62 82

int t ;
string s ;
set < char > S ;

int main(){

    cin >> t ;
    while ( t-- ){
        cin >> s ;
        for ( int i = 0 ; i < s.size() ; i++ ){
                S.insert(s[i]) ;
        }
        if ( S.size() == 1 ){
                cout << -1 << "\n";
                continue ;
        }
        sort ( s.begin() , s.end() ) ;
        if ( s[1] == s[s.size()-1] ){
            cout << -1 << "\n" ; continue ;
        }
        cout << s << "\n";
    }

}


#include <bits/stdc++.h>

using namespace std ;

const int N = 1e2 + 5;
const int INF = 1e9 ;

//+992 905 55 82 70 ;
// 90 900 62 82

int t ;
string s ;
set < char > S ;

int main(){

    cin >> t ;
    while ( t-- ){
        cin >> s ;
        for ( int i = 0 ; i < s.size() ; i++ ){
                S.insert(s[i]) ;
        }
        if ( S.size() == 1 ){
                cout << -1 << "\n";
                continue ;
        }
        sort ( s.begin() , s.end() ) ;
        if (s[i] == s[s.size()-1]){
            cout << -1 ; continue ;
        }
        cout << s << "\n";
    }

}


#include <bits/stdc++.h>

using namespace std ;

const int N = 1e2 + 5;
const int INF = 1e9 ;

//+992 905 55 82 70 ;
// 90 900 62 82

int t ;
string s ;
set < char > S ;

int main(){

    cin >> t ;
    while ( t-- ){
        cin >> s ;
        for ( int i = 0 ; i < s.size() ; i++ ){
                S.insert(s[i]) ;
        }
        if ( S.size() == 1 ){
                cout << -1 << "\n";
                continue ;
        }
        if ( S.size() == 2 ){
                for ( int i = 0 ; i < s.size() ; i++ ){
                    if ( s[i] != s[i+1] ){
                            swap(s[i],s[s.size()-1]) ;
                            break ;
                    }
                }
        }
        else{
                for ( int i = 0 ; i < int(s.size()) - 1 ; i++ ){
                        swap(s[i],s[(s.size())-i-1]) ;
                        swap(s[i],s[i+1]) ;
                }
        }
        cout << s << "\n";
    }

}


#include <bits/stdc++.h>

using namespace std ;

const int N = 1e2 + 5;
const int INF = 1e9 ;

//+992 905 55 82 70 ;
// 90 900 62 82

int t ;
string s ;
set < char > S ;

int main(){

    cin >> t ;
    while ( t-- ){
        cin >> s ;
        for ( int i = 0 ; i < s.size() ; i++ ){
                S.insert(s[i]) ;
        }
        if ( S.size() == 1 ){
                cout << -1 << "\n";
                continue ;
        }
        if ( S.size() == 2 ){
                for ( int i = 0 ; i < s.size() ; i++ ){
                    if ( s[i] != s[i+1] ){
                            swap(s[i],s[s.size()-1]) ;
                            break ;
                    }
                }
        }
        else{
                for ( int i = 0 ; i < int(s.size()) - 1 ; i++ ){
                        swap(s[i],s[i+1]) ;
                }
        }
        cout << s << "\n";
    }

}


#include <bits/stdc++.h>

using namespace std ;

const int N = 1e2 + 5;
const int INF = 1e9 ;

//+992 905 55 82 70 ;
// 90 900 62 82

int t ;
string s ;
set < char > S ;

int main(){

    cin >> t ;
    while ( t-- ){
        cin >> s ;
        for ( int i = 0 ; i < s.size() ; i++ ){
                S.insert(s[i]) ;
        }
        if ( S.size() == 1 ){
                cout << -1 << "\n";
                continue ;
        }
        if ( S.size() == 2 ){
                for ( int i = 0 ; i < s.size() ; i++ ){
                    if ( s[i] != s[i+1] ){
                            swap(s[i],s[s.size()-1]) ;
                            break ;
                    }
                }
        }
        else{
                for ( int i = 1 ; i < int(s.size()) ; i++ ){
                        swap(s[i],s[i-1]) ;
                }
        }
        cout << s << "\n";
    }

}


#include <bits/stdc++.h>

using namespace std ;

const int N = 1e2 + 5;
const int INF = 1e9 ;

//+992 905 55 82 70 ;
// 90 900 62 82

int t ;
string s ;
set < char > S ;

int main(){

    cin >> t ;
    while ( t-- ){
        cin >> s ;
        for ( int i = 0 ; i < s.size() ; i++ ){
                S.insert(s[i]) ;
        }
        if ( S.size() == 1 ){
                cout << -1 << "\n";
                continue ;
        }
        sort ( s.begin() , s.end() ) ;
        if ( s[0] == s[s.size()-1] ){
            cout << -1 << "\n" ; continue ;
        }
        cout << s << "\n";
    }

}


#include <bits/stdc++.h>

using namespace std ;

const int N = 1e2 + 5;
const int INF = 1e9 ;

//+992 905 55 82 70 ;
// 90 900 62 82

int t ;
string s ;
set < char > S ;

int main(){

    cin >> t ;
    while ( t-- ){
        cin >> s ;
        for ( int i = 0 ; i < s.size() ; i++ ){
                S.insert(s[i]) ;
        }
        if ( S.size() == 1 ){
                cout << -1 << "\n";
                continue ;
        }
        sort ( s.begin() , s.end() ) ;
        cout << s << "\n";
    }

}


#include <bits/stdc++.h>

using namespace std;
int l,k,j,c;
string s;
int main()
{
    int n;
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>s;
        k=s.size(),l=0,c=0;
        while(s[l]==s[k-1]){
            c++;
            l++;
            k--;
        }
        j=0;
        if(c==s.size())
        while(1){
            swap(s[j],s[j+1]);
            j++;
            if(j==s.size()-1)break;
        }
        c=0,l=0,k=s.size();
        while(s[l]==s[k-1]){
            c++;
            l++;
            k--;
        }
        if(c==s.size())
            cout<<-1<<endl;
        else
            cout<<s<<endl;
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;
int l,k,j,c;
string s;
int main()
{
    int n;
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>s;
        k=s.size(),l=0,c=0;
        while(s[l]==s[k-1]){
            c++;
            l++;
            k--;
            if(k<0){
                break;
            }
        }
        j=0;
        if(c==s.size())
        while(1){
            swap(s[j],s[j+1]);
            j++;
            if(j==s.size()-1)break;
        }
        c=0,l=0,k=s.size();
        while(s[l]==s[k-1]){
            c++;
            l++;
            k--;
            if(k<0){
                break;
            }
        }
        if(c==s.size())
            cout<<-1<<endl;
        else
            cout<<s<<endl;
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;
int l,k,j,c;
string s;
int main()
{
    int n;
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>s;
        k=s.size(),l=0,c=0;
        while(s[l]==s[k-1]){
            c++;
            l++;
            k--;
            if(k==0){
                break;
            }
        }
        j=0;
        if(c==s.size())
        while(1){
            if(j==s.size()-1)break;
            swap(s[j],s[j+1]);
            j++;
        }
        c=0,l=0,k=s.size();
        while(s[l]==s[k-1]){
            c++;
            l++;
            k--;
            if(k==0){
                break;
            }
        }
        if(c==s.size())
            cout<<-1<<endl;
        else
            cout<<s<<endl;
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;
int l,k,j,c;
string s;
int main()
{
    int n;
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>s;
        k=s.size(),l=0,c=0;
        while(s[l]==s[k-1]){
            c++;
            l++;
            k--;
            if(k==0){
                break;
            }
        }
        j=0;
        if(c==s.size())
        while(1){
            swap(s[j],s[j+1]);
            j++;
            if(j==s.size()-1)break;
        }
        c=0,l=0,k=s.size();
        while(s[l]==s[k-1]){
            c++;
            l++;
            k--;
            if(k==0){
                break;
            }
        }
        if(c==s.size())
            cout<<-1<<endl;
        else
            cout<<s<<endl;
    }
    return 0;
}


#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main()
{
	int n;
	cin>>n;
	while(n--)
	{
		string a,b;
		cin>>a;
		b=a;
		reverse(b.begin(),b.end());
		if(a!=b)
			cout<<a<<endl;
		else if(a==b)
		{
			if(a.length()==2 || a.length()==1)
				cout<<-1<<endl;
			else
			{
				swap(a[0],a[1]);
				cout<<a<<endl;
			}

		}
	}
	return 0;
 }


#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main()
{
	int n;
	cin>>n;
	while(n--)
	{
		string a,b;
		cin>>a;
		b=a;
		reverse(b.begin(),b.end());
		if(a!=b)
			cout<<a<<endl;
		else if(a==b)
		{
			if(a.length()==2 || a.length()==1)
				cout<<-1<<endl;
			else
			{
				swap(a[0],a[n/2]);
				cout<<a<<endl;
			}

		}
	}
	return 0;
 }


#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main()
{
	int n;
	cin>>n;
	while(n--)
	{
		string a,b;
		cin>>a;
		b=a;
		reverse(b.begin(),b.end());
		if(a!=b)
			cout<<a<<endl;
		else if(a==b)
		{
			if(a.length()==2 || a.length()==1)
				cout<<-1<<endl;
			else
			{
				swap(a[0],a[a.length()/2]);
				cout<<a<<endl;
			}

		}
	}
	return 0;
 }


#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main()
{
	int n;
	cin>>n;
	while(n--)
	{
		string a,b;
		int i,j;
		cin>>a;
		b=a;
		reverse(b.begin(),b.end());
		if(a!=b)
			cout<<a<<endl;
		else if(a==b)
		{
			bool f=false;
			for(j=1;j<a.length();j++)
			{
				if(a[j-1]!=a[j])
				{
					swap(a[j-1],a[j]);
					f=true;
					break;
				}
			}
			if(!f)
				cout<<-1<<endl;
			else
			{
				cout<<a<<endl;
			}

		}
	}
	return 0;
 }


#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main()
{
	int n;
	cin>>n;
	while(n--)
	{
		string a,b;
		cin>>a;
		b=a;
		reverse(b.begin(),b.end());
		if(a!=b)
			cout<<a<<endl;
		else if(a==b)
		{
			if(a.length()==2 || a.length()==1)
				cout<<-1<<endl;
			else
			{
				sort(a.begin(),a.end());
				cout<<a<<endl;
			}

		}
	}
	return 0;
 }


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
    ll n,i,k=0,m;
    cin>>n;
    string s;
    for(i=0; i<n; i++)
    {
        cin>>s;
        bool p=true;
        ll j;
        for(j=0; j<=s.size()/2; j++)
          {
              if(s[j]!=s[s.size()-1-j])
                break;
              if(p==true &&s[i]!=s[0])
                p=false;
          }
          if(j>s.size())
          {
            if(p==true)
            cout<<"-1"<<endl;
            else
            {
                for(i=1;i<=s.size()+1; i++)
                    if(s[i]!=s[i-1])
                     break;
                char o=s[i];
                s[i]=s[i-1];
                s[i-1]=o;
                cout<<s<<endl;
            }
          }
          else
            cout<<s<<endl;
    }
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
    ll n,i,k=0,m;
    cin>>n;
    string s;
    for(i=0; i<n; i++)
    {
        cin>>s;
        bool p=true;
        ll j;
        for(j=0; j<=s.size()/2; j++)
          {
              if(s[j]!=s[s.size()-1-j])
                break;
              if(p==true &&s[i]!=s[0])
                p=false;
          }
          if(j>s.size())
          {
            if(p==false)
            cout<<"-1"<<endl;
            else
            {
                for(i=1;i<=s.size()+1; i++)
                    if(s[i]!=s[i-1])
                     break;
                char o=s[i];
                s[i]=s[i-1];
                s[i-1]=o;
                cout<<s<<endl;
            }
          }
          else
            cout<<s<<endl;
    }
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
    ll n,i,k=0,m;
    cin>>n;
    string s;
    for(i=0; i<n; i++)
    {
        vector<ll>a(26);
        cin>>s;
        sort(s.begin(),s.end());
        for(i=0; i<=s.size()/2; i++)
          if(s[i]!=s[s.size()-1-i])
            break;
          if(i>s.size())
            cout<<"-1"<<endl;
          else
            cout<<s<<endl;
    }
}


import java.io.*;
import java.util.*;
public class Main {
    public static void main(String[] args) throws Exception {
        Reader.init(System.in);
        int n = Reader.nextInt();
        int [] freq = new int [101];
        int c = 0 , count = 0 ;
        for (int i=0 ; i<n ; i++){
            freq[Reader.nextInt()]++;
        }
        Arrays.sort(freq);
        for (int i=freq.length-1 ; i>=0 ; i--) {
            if (freq[i]==0)
                break ;
            if (freq[i]>4) {
                c++;
                freq[i]-=4 ;
                i++ ;
            } else if (freq[i]==4) {
                freq[i]=0 ;
                c++;
            } else if (freq[i]>=2) {
                freq[i]=0 ;
                count++;
                if (count%2==0)
                    c++ ;
            }
        }
        System.out.println(c);

    }
    public static int BS(int[] a, int key, int num) {
        int low = 0;
        int high = a.length - 1;
        while (low <= high) {
            int mid = low + (high - low) / 2;
            if (a[mid] == key && mid != num) {
                return mid;
            } else if (a[mid] < key) {
                low = mid + 1;
            } else {
                high = mid - 1;
            }
        }
        return -1;
    }

    public static boolean isSorted(int[] a) {

        int i;
        for (i = 0; i < a.length - 1; i++) {
            if (a[i] < a[i + 1]) {
                continue;
            } else {
                return false;
            }
        }
        return true;
    }

    public static void fill(int[] a) throws Exception {
        for (int i = 0; i < a.length; i++) {
            a[i] = Reader.nextInt();
        }
    }

    static void s(int[] cc) {
        for (int e = 0; e < cc.length; e++) {
            for (int q = e + 1; q < cc.length; q++) {
                if (cc[e] < cc[q]) {
                    int g = cc[e];
                    cc[e] = cc[q];
                    cc[q] = g;
                }
            }
        }

    }

    static boolean isPalindrome(String s) {
        int n = s.length();
        for (int i = 0; i < (n / 2) + 1; ++i) {
            if (s.charAt(i) != s.charAt(n - i - 1)) {
                return false;
            }
        }

        return true;
    }
}
class MyPair
{
     String s ;
     int x;
     int y;

    public MyPair(String s,int x, int y)
    {
        this.s = s;
        this.x = x;
        this.y = y;
    }

}
class Reader {

    static BufferedReader reader;
    static StringTokenizer tokenizer;

    /**
     * call this method to initialize reader for InputStream
     */
    static void init(InputStream input) {
        reader = new BufferedReader(
                new InputStreamReader(input));
        tokenizer = new StringTokenizer("");
    }

    /**
     * get next word
     */
    static String next() throws IOException {
        while (!tokenizer.hasMoreTokens()) {
            //TODO add check for eof if necessary
            tokenizer = new StringTokenizer(
                    reader.readLine());
        }
        return tokenizer.nextToken();
    }

    static int nextInt() throws IOException {
        return Integer.parseInt(next());
    }

    static double nextDouble() throws IOException {
        return Double.parseDouble(next());
    }

    static long nextLong() throws IOException {
        return Long.parseLong(next());
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.StringTokenizer;

public class Problem127B
{
    public static void main(String[] args) throws IOException
    {
        fastinput.init(System.in);
        int n = fastinput.nextInt();
        HashMap<Integer, Integer> h1 = new HashMap<Integer, Integer>();
        ArrayList<Integer> sticks = new ArrayList<Integer>(n);
        for (int i = 0; i < n; i++)
        {
            Integer s = fastinput.nextInt();
            Integer t = h1.get(s);
            if (t == null)
            {
                h1.put(s, 1);
                sticks.add(s);
            }
            else
            {
                h1.put(s, t+1);
            }
        }
        int count = 0;
        int count2 = 0;
        for (int j = 0; j < sticks.size(); j++)
        {
            int p = sticks.get(j);
            int q = h1.get(p);
            if (q >= 4)
            {
                count = count + (q/4);
                q = q % 4;
                h1.put(p, q);
            }
            if (q >= 2)
            {
                count2 = count2 + (q/2);
                q = q % 2;
                h1.put(p, q);
            }
        }
        count = count + (count2/2);
        System.out.println(count);
    }

    public static class fastinput
    {
        static BufferedReader bf;
        static StringTokenizer st;

        static void init(InputStream input)
        {
            bf = new BufferedReader(new InputStreamReader(input));
            st = new StringTokenizer("");
        }

        static String next() throws IOException
        {
            while (!st.hasMoreTokens())
            {
                st = new StringTokenizer(bf.readLine());
            }
            return st.nextToken();
        }

        static int nextInt() throws IOException
        {
            return Integer.parseInt(next());
        }
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.StringTokenizer;

public class Problem127B
{
    public static void main(String[] args) throws IOException
    {
        fastinput.init(System.in);
        int n = fastinput.nextInt();
        HashMap<Integer, Integer> h1 = new HashMap<Integer, Integer>();
        ArrayList<Integer> sticks = new ArrayList<Integer>(n);
        for (int i = 0; i < n; i++)
        {
            Integer s = fastinput.nextInt();
            Integer t = h1.get(s);
            if (t == null)
            {
                h1.put(s, 1);
                sticks.add(s);
            }
            else
            {
                h1.put(s, t+1);
            }
        }
        Collections.sort(sticks);
        int count = 0;
        int count2 = 0;
        for (int j = 0; j < sticks.size(); j++)
        {
            int p = sticks.get(j);
            int q = h1.get(p);
            if (q >= 4)
            {
                count = count + (q/4);
                q = q % 4;
                h1.put(p, q);
            }
            if (q >= 2)
            {
                count2 = count2 + (q/2);
                q = q % 2;
                h1.put(p, q);
            }
        }
        count = count + (count2/2);
        System.out.println(count);
    }

    public static class fastinput
    {
        static BufferedReader bf;
        static StringTokenizer st;

        static void init(InputStream input)
        {
            bf = new BufferedReader(new InputStreamReader(input));
            st = new StringTokenizer("");
        }

        static String next() throws IOException
        {
            while (!st.hasMoreTokens())
            {
                st = new StringTokenizer(bf.readLine());
            }
            return st.nextToken();
        }

        static int nextInt() throws IOException
        {
            return Integer.parseInt(next());
        }
    }
}


import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.IOException;
import java.util.StringTokenizer;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskB solver = new TaskB();
        solver.solve(1, in, out);
        out.close();
    }
}

class TaskB {
    public void solve(int testNumber, InputReader in, PrintWriter out) {
        int n = in.nextInt();
        int[] count = new int[101];
        for (int i = 0; i < n; i++) {
            count[in.nextInt()]++;
        }
        int res = 0;
        for (int i = 1; i <= 100; i++) {
            for (int j = 1; j <= 100; j++) {
                if (i == j) {
                    int current = count[i] / 4;
                    count[i] -= current * 4;
                    res += current;
                } else {
                    int current = Math.min(count[i] / 2, count[j] / 2);
                    count[i] -= current * 2;
                    count[j] -= current * 2;
                    res += current;
                }
            }
        }
        out.println(res);
    }
}

class InputReader {
    public BufferedReader reader;
    public StringTokenizer tokenizer;

    public InputReader(InputStream stream) {
        reader = new BufferedReader(new InputStreamReader(stream), 32768);
        tokenizer = null;
    }

    public String next() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken();
    }

    public int nextInt() {
        return Integer.parseInt(next());
    }

}


import java.io.*;
import java.util.*;
public class j
{
public static void main(String a[])throws IOException
{
BufferedReader b=new BufferedReader(new InputStreamReader(System.in));
int t=0,p=0,j=0,n=0,i=0;
int d[];
int e[];
String s;
n=Integer.parseInt(b.readLine());
d=new int[n];
e=new int[101];
int f[]=new int[101];
f[0]=0;
s=b.readLine();
StringTokenizer c=new StringTokenizer(s);
for(i=0;i<n;i++)
d[i]=Integer.parseInt(c.nextToken());
for(i=0;i<101;i++)
for(j=0;j<n;j++)
if(d[j]==i)
f[i]++;
for(i=0;i<101;i++)
{
e[i]=f[i]/4;
f[i]=f[i]%4;
t+=e[i];
}
for(i=0;i<101;i++)
if(f[i]==2||f[i]==3)
p++;
t+=p/2;
System.out.print(t);
}
}


/*
* @Author: steve
* @Date:   2015-11-05 15:36:02
* @Last Modified by:   steve
* @Last Modified time: 2015-11-05 15:40:36
*/
import java.io.*;
import java.util.*;

public class CanvasFrames {
    public static void main(String[] args) throws Exception{
    	BufferedReader entrada = new BufferedReader(new InputStreamReader(System.in));
    	int n = Integer.parseInt(entrada.readLine());
    	int[] nu = new int[101];
    	String[] cads = entrada.readLine().split(" ");
    	for(int i=0;i<n;i++)
    		nu[Integer.parseInt(cads[i])]++;
    	int cant=0;
    	for(int i=0;i<101;i++)
    		cant+=nu[i]/2;
    	int t = cant/2;
    	System.out.println(t);
    }
}


import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Scanner;

public class Task127B {

	public static void main(String... args) throws NumberFormatException,
			IOException {
		Solution.main(System.in, System.out);
	}

	static class Solution {

		public static void main(InputStream is, OutputStream os)
				throws NumberFormatException, IOException {
			PrintWriter pw = new PrintWriter(os);
			Scanner s = new Scanner(is);

			int n = s.nextInt();

			int sticks[] = new int[101];

			for (int i = 0; i < n; i++) {
				sticks[s.nextInt()]++;
			}

			int pairsCount = 0;

			for (int i = 1; i <= 100; i++) {
				pairsCount += sticks[i]/2;
			}

			pw.write(pairsCount/2+"");

			pw.flush();
			s.close();
		}
	}

}


import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Scanner;

public class Task127B {

	public static void main(String... args) throws NumberFormatException,
			IOException {
		Solution.main(System.in, System.out);
	}

	static class Solution {

		public static void main(InputStream is, OutputStream os)
				throws NumberFormatException, IOException {
			PrintWriter pw = new PrintWriter(os);
			Scanner s = new Scanner(is);

			int n = s.nextInt();

			int sticks[] = new int[101];

			for (int i = 0; i < n; i++) {
				sticks[s.nextInt()]++;
			}

			int pairsCount = 0;

			for (int i = 1; i <= 100; i++) {
				pairsCount += sticks[i]/2;
			}

			pw.write(pairsCount/2);

			pw.flush();
			s.close();
		}
	}

}


import java.util.*;
import java.lang.Math;

public class canvas{
	public static void main (String[] args){
		Scanner sc = new Scanner (System.in);
		int n = sc.nextInt();
		int[] arr = new int[n];
		for (int i = 0; i < n; ++i){
			arr[i] = sc.nextInt();
		}
		Arrays.sort(arr);
		int pairs = 0;
		int last = 0;
		for (int i = 0; i < n; ++i){
			if (arr[i] == last){
				pairs = pairs + 1;
				last = 0;
			}
			else {
				last = arr[i];
			}
		}

		System.out.println(pairs/2);
	}
}


import java.util.*;
import java.lang.Math;
import java.io.*;

public class canvas{
	public static void main (String[] args){
		MyScanner sc = new MyScanner ();
		int n = sc.nextInt();
		out = new PrintWriter(new BufferedOutputStream(System.out), true);
		int[] arr = new int[105];
		for (int i = 0; i < 101; ++i){
			arr[i] = 0;
		}

		for (int i = 0; i < n; ++i){
			int temp = sc.nextInt();
			arr[temp] += 1;
		}

		for (int i = 0; i < 101; ++i){
			arr[i] = arr[i]/2;
		}
		int total = 0;
		for (int i = 0; i < 101; ++i){
			total += arr[i];
		}

		out.println(total/2);

	}

	public static PrintWriter out;

   public static class MyScanner {
        BufferedReader br;
        StringTokenizer st;

        public MyScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() { return Integer.parseInt(next()); }
        long nextLong() { return Long.parseLong(next()); }
        double nextDouble() { return Double.parseDouble(next()); }

        String nextLine(){
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }

}


import java.util.*;
import java.lang.Math;
import java.io.*;

public class canvas{
	public static void main (String[] args){
		MyScanner sc = new MyScanner ();
		int n = sc.nextInt();
		out = new PrintWriter(new BufferedOutputStream(System.out), true);
		int[] arr = new int[n];
		for (int i = 0; i < n; ++i){
			arr[i] = sc.nextInt();
		}
		Arrays.sort(arr);
		int pairs = 0;
		int last = 0;
		for (int i = 0; i < n; ++i){
			if (arr[i] == last){
				pairs = pairs + 1;
				last = 0;
			}
			else {
				last = arr[i];
			}
		}

		out.println(pairs/2);
	}

	public static PrintWriter out;

   public static class MyScanner {
        BufferedReader br;
        StringTokenizer st;

        public MyScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() { return Integer.parseInt(next()); }
        long nextLong() { return Long.parseLong(next()); }
        double nextDouble() { return Double.parseDouble(next()); }

        String nextLine(){
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }

}


import java.util.*;
import java.lang.Math;
import java.io.*;

public class canvas{
	public static void main (String[] args){
		MyScanner sc = new MyScanner ();
		int n = sc.nextInt();
		int[] arr = new int[n];
		for (int i = 0; i < n; ++i){
			arr[i] = sc.nextInt();
		}
		Arrays.sort(arr);
		int pairs = 0;
		int last = 0;
		for (int i = 0; i < n; ++i){
			if (arr[i] == last){
				pairs = pairs + 1;
				last = 0;
			}
			else {
				last = arr[i];
			}
		}

		out.println(pairs/2);
	}

	public static PrintWriter out;

   public static class MyScanner {
        BufferedReader br;
        StringTokenizer st;

        public MyScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() { return Integer.parseInt(next()); }
        long nextLong() { return Long.parseLong(next()); }
        double nextDouble() { return Double.parseDouble(next()); }

        String nextLine(){
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }

}


import java.util.Arrays;
import java.util.Scanner;

public class Task127B {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] a = new int[n];
		for (int i = 0; i < n; i++) {
			a[i] = sc.nextInt();
		}
		sc.close();

		Arrays.sort(a);

		int c = 0;
		for (int i = 0; i < n - 1; i++) {
			if (a[i] == a[i + 1]) {
				c++;
				i++;
			}
		}
		System.out.println(c / 2);
	}
}


import java.lang.*;
import java.io.*;
import java.util.*;

public class Frames {

	public static void main(String[] args) throws java.lang.Exception {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskA solver = new TaskA();
		solver.solve(in, out);
		out.close();
	}
}

class TaskA {
	public final static int maxn = 105;
	int[] c = new int[maxn];

	public void solve(InputReader in, PrintWriter out) {
		int n = in.nextInt();
		int i, j, k = 0;
		int ans = 0;

		for (i=0; i<n; ++i)
			++c[in.nextInt()];

		for (i=1; i<=100; ++i) {
			ans += c[i] / 4;
			if ((c[i] & 3) >= 2)
				++k;
		}

		ans += k / 2;
		out.println(ans);
	}
}

class InputReader {
	public BufferedReader reader;
	public StringTokenizer tokenizer;

	public InputReader(InputStream stream) {
		reader = new BufferedReader(new InputStreamReader(stream), 32768);
		tokenizer = null;
	}

	public String next() {
		while (tokenizer==null || !tokenizer.hasMoreTokens()) {
			try {
				tokenizer = new StringTokenizer(reader.readLine());
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
		}
		return tokenizer.nextToken();
	}

	public int nextInt() {
		return Integer.parseInt(next());
	}

	public long nextLong() {
		return Long.parseLong(next());
	}
}


import java.util.*;

public class p127B {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);

		int n = in.nextInt();
		int[] arr = new int[101];
		Arrays.fill(arr, 0);

		for(int i=0; i<n; ++i) ++arr[in.nextInt()];

		int count = 0;
		for(int i=0; i<101; ++i) {
			count += (arr[i]/2);
		}

		count /= 2;

		System.out.println(count);
	}
}


import java.util.Arrays;
import java.util.Scanner;

public class CanvasFrames {
    public static void main(String asd[])throws Exception
    {
        Scanner in=new Scanner(System.in);
        int n=in.nextInt();
       int b[]=new int[101];
       Arrays.fill(b,0);
        for(int i=0;i<n;i++)
            b[in.nextInt()]++;
        Arrays.sort(b);
        int k=0,m=0;
        while(k<101 && b[k]<=1)
            k++;
        int y=100;
        while(y>=0&&b[y]>=4)
        {
            m+=b[y]/4;
            b[y]%=4;
            y--;
        }
        Arrays.sort(b);int yy=0;
        while(k<101 && b[k]<=1)
            k++;
        while(k<101 && b[k]>=2)
        {
           yy++;k+=1;
        }
        System.out.println(m+yy/2);
    }
}


import java.util.*;
import java.io.*;
public class palosmaricas{
public static void main(String args[]) throws IOException{
BufferedReader lector = new BufferedReader(new InputStreamReader(System.in));
int tmp = Integer.parseInt(lector.readLine());
int r = 0;
int a[] = new int[101];
String t[] = lector.readLine().split(" ");
for(int n = 0;n<t.length;n++){
int x = Integer.parseInt(t[n]);
a[x]^=1;
if(a[x]==0)r++;
}
System.out.println(r/2);
}
}


import java.util.Scanner;

public class Main {
    static final int SIZE = 101;
    public static void main(String[] arg){
        int[] sticks = new int[SIZE];

        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();

        for (int i = 0; i < n; i++) {
            sticks[sc.nextInt()]++;
        }

        int pairs = 0;
        for (int i = 0; i < SIZE; i++) {
            pairs += (sticks[i]/2);
        }

        System.out.println(pairs/2);

    }
}


public class Main {
    static final int SIZE = 101;
    public static void main(String[] arg){
        int[] sticks = new int[SIZE];

        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();

        for (int i = 0; i < n; i++) {
            sticks[sc.nextInt()]++;
        }

        int pairs = 0;
        for (int i = 0; i < SIZE; i++) {
            pairs += (sticks[i]/2);
        }

        System.out.println(pairs/2);

    }
}
import java.util.Scanner;

public class Main {
    static final int SIZE = 101;
    public static void main(String[] arg){
        int[] sticks = new int[SIZE];

        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();

        for (int i = 0; i < n; i++) {
            sticks[sc.nextInt()]++;
        }

        int pairs = 0;
        for (int i = 0; i < SIZE; i++) {
            pairs += (sticks[i]/2);
        }

        System.out.println(pairs/2);

    }
}


import java.util.*;
import java.io.*;
public class CanvasFrames
{
	public static void main(String[] args)
	{
		Scanner in = new Scanner(System.in);

		int n = in.nextInt();

		int[] sticks = new int[101];
		for(int x = 0; x < n; x++)
		{
			sticks[in.nextInt()]++;
		}

		int pairs = 0;
		for(int y = 0; y < sticks.length; y++)
		{
			pairs += sticks[y] / 2;
		}

		System.out.println(pairs / 2);
	}
}


import java.io.*;
import java.util.*;

public class q2{
    public static void main(String[] args) throws IOException
    {
        BufferedReader keyboardInput = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st;

        int n = Integer.parseInt(keyboardInput.readLine());

        int[] sticks = new int[n];
        st = new StringTokenizer(keyboardInput.readLine());
        for(int i = 0; i < n; i++){
            sticks[i] = Integer.parseInt(st.nextToken());
        }
        boolean[] sticksA = new boolean[n];
        for(int i = 0; i < n; i++){
            sticksA [i] = true;
        }

        int doubles = 0;
        for(int i = 0; i < n; i++){
            if(sticksA[i]){
                for(int j = 0; j < n; j++){
                    if(sticks[i] == sticks[j] && sticksA[j] && i != j){
                        doubles ++;
                        sticksA[i] = false;
                        sticksA[j] = false;
                        break;
                    }
                }
            }
        }

        int frames = doubles/2;
        System.out.println(frames);
    }
}


import java.util.*;

public final class canvas_frames
{
	public static void main(String args[])
	{
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int a[] = new int[n];
		for(int i=0;i<n;i++)
		{
			a[i]=sc.nextInt();
		}
		Arrays.sort(a);
		int i=0,ctr=0;
		while(i<=n-4)
		{
			if(a[i++]==a[i])
			{
				i++;
				for(int j=i;j<=n-2;)
				{
					if(a[j++]==a[j])
					{
						ctr++;
						i=++j;
						break;
					}
				}
			}
		}
		System.out.println(ctr);
	}
}


import java.util.*;

public final class canvas_frames
{
	public static void main(String args[])
	{
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int a[] = new int[n];
		for(int i=0;i<n;i++)
		{
			a[i]=sc.nextInt();
		}
		Arrays.sort(a);
		int i=0,ctr=0;
		while(i<=n-4)
		{
			if(a[i++]==a[i])
			{
				i++;
				for(int j=i;j<=n-2;j++)
				{
					if(a[j++]==a[j])
					{
						ctr++;
						i=++j;
						break;
					}
				}
			}
		}
		System.out.println(ctr);
	}
}


import java.util.Scanner;
public class Frames {
public static void main(String[] args){
    Scanner input=new Scanner(System.in);
    int n=input.nextInt();
    int a[]=new int [n];
    int swap;
    int counter=0;

    for (int i=0;i<=n-1;i++){
        a[i]=input.nextInt();
    }
    for (int i=0;i<=n-1;i++){
        a[i]=a[i]-48;
    }
    for (int i=0;i<=n-1;i++){
        for (int j=0;j<=n-2;j++){
            if(a[j]>=a[j+1]){
                swap=a[j+1];
                a[j+1]=a[j];
                a[j]=swap;

            }
        }
    }
//  for (int element:a){
//      System.out.print(element);
//  }

    for (int i=0;i<=n-2;i++){
        if (a[i]==a[i+1]){
            counter=counter+1;
            i=i+1;
        }
    }
    //System.out.println(counter);
    counter=counter/2;
    System.out.print(counter);
}
}


import java.util.Scanner;

public class B127 {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        boolean oddTimes[] = new boolean[1000];
        int count = 0;
        for (int i = 0; i < n; ++i) {
            int t = in.nextInt();
            if (oddTimes[t]) {
                count++;
            }
            oddTimes[t] = !oddTimes[t];
        }
        System.out.println(count / 2);

    }

}


import java.io.*;
import java.util.*;

public class B127 {
  static FastScanner in;
  static FastPrinter out;

  public static void main(String[] args) throws IOException {
    in = new FastScanner(System.in);
    out = new FastPrinter(System.out);
    int[] cnt = new int[100];
    int n = in.nextInt();
    for (int i = 0; i < n; i++)
      cnt[in.nextInt() - 1]++;
    int p = 0;
    for (int i : cnt)
      p += i / 2;
    out.println(p / 2);
    out.close();
  }

  static class FastPrinter extends PrintWriter {
    public FastPrinter(File f) throws IOException {
      super(new BufferedWriter(new FileWriter(f)));
    }

    public FastPrinter(OutputStream out) throws IOException {
      super(new BufferedWriter(new OutputStreamWriter(out)));
    }
  }

  static class FastScanner {
    BufferedReader br;
    StringTokenizer st;

    public FastScanner(InputStream in) {
      br = new BufferedReader(new InputStreamReader(in));
      st = new StringTokenizer("");
    }

    public int nextInt() throws IOException {
      return Integer.parseInt(next());
    }

    public long nextLong() throws IOException {
      return Long.parseLong(next());
    }

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

    public String next() throws IOException {
      if (st.hasMoreTokens()) return st.nextToken();
      st = new StringTokenizer(br.readLine());
      return next();
    }
  }

}


import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.StringTokenizer;

public class CodeA
{
	static class Scanner
	{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer("");

		public String nextLine()
		{
			try
			{
				return br.readLine();
			}
			catch(Exception e)
			{
				throw(new RuntimeException());
			}
		}

		public String next()
		{
			while(!st.hasMoreTokens())
			{
				String l = nextLine();
				if(l == null)
					return null;
				st = new StringTokenizer(l);
			}
			return st.nextToken();
		}

		public int nextInt()
		{
			return Integer.parseInt(next());
		}

		public long nextLong()
		{
			return Long.parseLong(next());
		}

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

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

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

		public double[] nextDoubleArray(int n)
		{
			double[] res = new double[n];
			for(int i = 0; i < res.length; i++)
				res[i] = nextLong();
			return res;
		}
		public void sortIntArray(int[] array)
		{
			Integer[] vals = new Integer[array.length];
			for(int i = 0; i < array.length; i++)
				vals[i] = array[i];
			Arrays.sort(vals);
			for(int i = 0; i < array.length; i++)
				array[i] = vals[i];
		}

		public void sortLongArray(long[] array)
		{
			Long[] vals = new Long[array.length];
			for(int i = 0; i < array.length; i++)
				vals[i] = array[i];
			Arrays.sort(vals);
			for(int i = 0; i < array.length; i++)
				array[i] = vals[i];
		}

		public void sortDoubleArray(double[] array)
		{
			Double[] vals = new Double[array.length];
			for(int i = 0; i < array.length; i++)
				vals[i] = array[i];
			Arrays.sort(vals);
			for(int i = 0; i < array.length; i++)
				array[i] = vals[i];
		}

		public String[] nextStringArray(int n)
		{
			String[] vals = new String[n];
			for(int i = 0; i < n; i++)
				vals[i] = next();
			return vals;
		}

		Integer nextInteger()
		{
			String s = next();
			if(s == null)
				return null;
			return Integer.parseInt(s);
		}

		int[][] nextIntMatrix(int n, int m)
		{
			int[][] ans = new int[n][];
			for(int i = 0; i < n; i++)
				ans[i] = nextIntArray(m);
			return ans;
		}
	}

	public static void main(String[] args)
	{
		Scanner sc = new Scanner();
		int n = sc.nextInt();
		int[] vals = sc.nextIntArray(n);
		int[] counts = new int[101];
		int pares = 0;
		for(int x : vals)
			counts[x]++;
		for(int i : counts)
			pares += i / 2;
		System.out.println(pares / 2);
	}

}


import java.util.*;
import java.math.*;

public class Piyush {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner in= new Scanner(System.in);
		int n;
		n=in.nextInt();
		int A[]=new int[101];
		int p;
		for(int i=0;i<n;i++)
		{
			p=in.nextInt();
			A[p]++;
		}
		int ans=0;
		for(int i=1;i<101;i++)
		{
			ans+=A[i]/4;
			A[i]%=4;
		}
		int t=0;
		for(int i=1;i<101;i++)
		{
			if(A[i]>=2)
			{
				if(t==0) t=1;
				else
				{
					ans++;
					t=0;
				}
			}

		}
		System.out.println(ans);
	}

}


import java.util.Scanner;

public class pa {
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int i=sc.nextInt();
		sc.nextLine();
		int t=0;
		int a[]=new int[i];
		for(int p=0;p<i;p++)
		{
			 a[p]=sc.nextInt();
			 int u;

			 for(u=p-1;u>-1;u--)
			 {
				 if(a[u]==a[p])
					 break;
			 }
			if(u!=-1)
			{
				a[u]=0;
				a[p]=0;
				t=t+1;
			}
		}
		System.out.println(t/2);

	}
}


import java.util.*;
import java.util.Map.Entry;

import org.ietf.jgss.Oid;

import sun.tools.jar.resources.jar;

public class yo{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt(), count = 0;
		int [] values = new int[n];
		for(int i = 0; i < n; i ++)
			values[i] = scan.nextInt();
		Arrays.sort(values);
		for(int i = 0; i < n-1; i ++){
			if(values[i]==values[i+1]){
				count++;
				i = i + 1;
			}
		}
		System.out.println(count/2);
	}
}


import java.util.*;

public class CanvasFrames {
    public static void main(String... args) {
        Scanner cin = new Scanner(System.in);
        int n = cin.nextInt();
        int[] t = new int[101];
        for (int i = 0; i < n; i++)
            t[cin.nextInt()]++;
        int p = 0;
        for (int i = 1; i < 101; i++) {
            p += t[i] / 2;
        }
        System.out.println(p / 2);
    }
}


import java.io.*;
import java.util.*;
public class casates
{
    public static void main(String args[])throws IOException
    {
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        int n;
         //System.out.println("enter");
         n=Integer.parseInt(br.readLine());
        int count=0;
        Map ob=new HashMap();
       // System.out.println("enter");
         StringTokenizer in=new StringTokenizer(br.readLine());

        for(int i=1;i<=n;i++)
        {
            int k=Integer.parseInt(in.nextToken());
            boolean bn=ob.containsKey(k);
            //System.out.println(bn);
            if(bn==true)
            {

               // System.out.println(k);
                count+=1;

                ob.remove(k);
            }
            else
            ob.put(k,i);
        }
        System.out.println(count/2);
    }
}


import java.io.*;
import java.util.*;

public class CanvasFrames {
	public static void main(String[] args) throws IOException {
		BufferedReader f = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(f.readLine());
		int[] a = new int[n];
		StringTokenizer st = new StringTokenizer(f.readLine());
		for (int i = 0; i < n; i++)
			a[i] = Integer.parseInt(st.nextToken());
		Arrays.sort(a);
		int count = 0;
		int length = 1;
		for (int i = 1; i < n; i++)
			if (a[i] == a[i-1])
				length++;
			else
			{
				count += length/2;
				length = 1;
			}
		count += length/2;
		System.out.println(count/2);
	}
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class CanvasFrames {

	public static void main(String[] args) throws IOException {
		PrintWriter out = new PrintWriter(System.out);
		sc = new StringTokenizer(br.readLine());
		int n = nxtInt();
		int[] a = new int[101];
		while (n-- > 0)
			a[nxtInt()]++;
		n = 0;
		for (int i = 0; i < a.length; i++)
			for (int j = 0; j < a.length; j++) {
				if (i != j && a[i] > 1 && a[j] > 1) {
					a[i] -= 2;
					a[j] -= 2;
					n++;
				}
				if (i == j && a[i] > 3) {
					a[i] -= 4;
					n++;
				}
			}
		out.println(n);
		br.close();
		out.close();
	}

	static BufferedReader br = new BufferedReader(new InputStreamReader(
			System.in));

	static StringTokenizer sc;

	static String nxtTok() throws IOException {
		while (!sc.hasMoreTokens()) {
			String s = br.readLine();
			if (s == null)
				return null;
			sc = new StringTokenizer(s.trim());
		}
		return sc.nextToken();
	}

	static int nxtInt() throws IOException {
		return Integer.parseInt(nxtTok());
	}

	static long nxtLng() throws IOException {
		return Long.parseLong(nxtTok());
	}
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class CanvasFrames {

	public static void main(String[] args) throws IOException {
		PrintWriter out = new PrintWriter(System.out);
		sc = new StringTokenizer(br.readLine());
		int n = nxtInt();
		int[] a = new int[101];
		while (n-- > 0)
			a[nxtInt()]++;
		n = 0;
		for (int i = 0; i < a.length; i++)
			n += a[i] / 2;
		out.println(n / 2);
		br.close();
		out.close();
	}

	static BufferedReader br = new BufferedReader(new InputStreamReader(
			System.in));

	static StringTokenizer sc;

	static String nxtTok() throws IOException {
		while (!sc.hasMoreTokens()) {
			String s = br.readLine();
			if (s == null)
				return null;
			sc = new StringTokenizer(s.trim());
		}
		return sc.nextToken();
	}

	static int nxtInt() throws IOException {
		return Integer.parseInt(nxtTok());
	}

	static long nxtLng() throws IOException {
		return Long.parseLong(nxtTok());
	}
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class CanvasFrames {

	public static void main(String[] args) throws IOException {
		PrintWriter out = new PrintWriter(System.out);
		sc = new StringTokenizer(br.readLine());
		int n = nxtInt();
		int[] a = new int[101];
		while (n-- > 0)
			a[nxtInt()]++;
		n = 0;
		for (int i = 0; i < a.length; i++)
			for (int j = 0; j < a.length; j++) {
				if (i != j && a[i] > 1 && a[j] > 1) {
					a[i] -= 2;
					a[j] -= 2;
					n++;
				}
				if (i == j && a[i] > 3) {
					n += a[i] / 4;
					a[i] -= a[i] * 4;
				}
			}
		out.println(n);
		br.close();
		out.close();
	}

	static BufferedReader br = new BufferedReader(new InputStreamReader(
			System.in));

	static StringTokenizer sc;

	static String nxtTok() throws IOException {
		while (!sc.hasMoreTokens()) {
			String s = br.readLine();
			if (s == null)
				return null;
			sc = new StringTokenizer(s.trim());
		}
		return sc.nextToken();
	}

	static int nxtInt() throws IOException {
		return Integer.parseInt(nxtTok());
	}

	static long nxtLng() throws IOException {
		return Long.parseLong(nxtTok());
	}
}


import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner input = new Scanner(System.in);
		int n = input.nextInt();
		int a[] = new int[101];
		for(int i = 0; i < n;i++){
			a[input.nextInt()]++;
		}
		int count = 0;
		for(int i = 0; i < a.length;i++){
			count += a[i]/2;
		}
		System.out.println(count/2);

	}
}


import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner input = new Scanner(System.in);
		int n = input.nextInt();
		int a[] = new int[100];
		for(int i = 0; i < n;i++){
			a[input.nextInt()]++;
		}
		int count = 0;
		for(int i = 0; i < a.length;i++){
			count += a[i]/2;
		}
		System.out.println(count/2);

	}
}


import java.util.Arrays;
import java.util.Scanner;

/**
 *
 * @author takhi
 */
public class frames_127B {
    public static void main(String args[]){
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int count=0;
        int arr[]=new int[n];
        for(int i=0;i<n;i++){
            arr[i]=sc.nextInt();
        }
        Arrays.sort(arr);
        for(int i=1;i<n;i++){
            if(arr[i-1]==arr[i]){
                count++;
                i++;
            }
        }
       System.out.println(count/2);

    }
}


import java.io.FileNotFoundException;
import java.io.InputStreamReader;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.FileReader;
import java.io.BufferedWriter;
import java.util.ArrayList;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.File;
import java.io.Writer;
import java.util.StringTokenizer;
import java.util.Collection;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 * @author unnamed
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		OutputWriter out = new OutputWriter(outputStream);
		TaskB solver = new TaskB();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskB {
    public void solve(int testNumber, InputReader in, OutputWriter out) {
        int n = in.nextInt(), a[] = IOUtils.readIntArray(in, n), m = ArrayUtils.maxArray(a), b[] = new int[m + 1];
        for (int i = 0; i < n; ++i)
            ++b[a[i]];
        int ans = 0;
        for (int i = 0; i <= m; ++i)
            ans += b[i] / 2;
        out.print(ans / 2);
    }
}

class InputReader {
    BufferedReader br;
    StringTokenizer st;

    public InputReader(File f) {
        try {
            br = new BufferedReader(new FileReader(f));
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }
    }

    public InputReader(InputStream f) {
        br = new BufferedReader(new InputStreamReader(f));
    }

    public String next() {
        while (st == null || !st.hasMoreTokens()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    public int nextInt() {
        return Integer.parseInt(next());
    }

    }

class OutputWriter {
    private final PrintWriter writer;

    public OutputWriter(OutputStream outputStream) {
        writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
    }

    public OutputWriter(Writer writer) {
        this.writer = new PrintWriter(writer);
    }

    public void print(Object... objects) {
        for (int i = 0; i < objects.length; i++) {
            if (i != 0)
                writer.print(' ');
            writer.print(objects[i]);
        }
    }

    public void close() {
        writer.close();
    }
}

class IOUtils {

    public static int[] readIntArray(InputReader in, int size) {
        int[] array = new int[size];
        for (int i = 0; i < size; i++)
            array[i] = in.nextInt();
        return array;
    }

    }

class ArrayUtils {

    public static int maxArray(int... array) {
        int ans = array[0];
        for (int i = 1; i < array.length; ++i)
            if (array[i] > ans) ans = array[i];
        return ans;
    }

    }


import java.util.Scanner;

public class B_127_Canvas_Frames {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int a[] = new int[101];
		for (int i = 1; i <= n; i++) {
			a[sc.nextInt()]++;
		}
		int count = 0;
		for (int i = 1; i <= 100; i++) {
			count += a[i] / 2;
		}
		System.out.println(count / 2);
	}
}


/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

import java.util.*;
import java.math.*;
import java.io.*;

/**
 *
 * @author magzhan
 */
public class Cf {

    public final static boolean isPerfectSquare(long n)
    {
        if (n < 0)
            return false;

        switch((int)(n & 0xF))
        {
        case 0: case 1: case 4: case 9:
            long tst = (long)Math.sqrt(n);
            return tst*tst == n;

        default:
            return false;
        }
    }

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        try {

            Scanner in = new Scanner(System.in);

            int n = in.nextInt();

            int[] a = new int[n];
            boolean[] u = new boolean[n];

            for (int i = 0; i < n; i++) {
                a[i] = in.nextInt();
            }

            int c = 0;

            for (int i = 0; i < n - 1; i++) {
                if (!u[i]) {
                    u[i] = true;
                    for (int j = i + 1; j < n; j++) {
                        if (a[i] == a[j] && !u[j]) {
                            u[j] = true;
                            c++;
                            break;
                        }
                    }
                }
            }

            if (c % 2 == 0) {
                System.out.println(c / 2);
            } else {
                System.out.println((c - 1) / 2);
            }
        } catch(Exception ex) {

            System.err.println(ex.toString());
        }
    }

}


import java.util.*;
public class Main{
public static void main(String... args){
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int[] t = new int[101];
for (int i=0; i<n; i++) t[sc.nextInt()]++;
int p = 0;
for (int i=1; i<101; i++){
  p+=t[i]/2;
}
System.out.println(p/2);
}
}


import java.util.Scanner;

public class B127 {

    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int N = input.nextInt();
        int[] stats = new int[101];
        for (int n=0; n<N; n++) {
            stats[input.nextInt()]++;
        }
        int pairs = 0;
        for (int value : stats) {
            pairs += value/2;
        }
        System.out.println(pairs/2);
    }

}


import java.util.Scanner;
import java.util.Arrays;
public class B127 {
    public static void main(String[] args){
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int[] a = new int[n];
        int count=0;
        for(int i =0;i<n;i++)
            a[i]=in.nextInt();
        Arrays.sort(a);
        for(int i =0;i<n-1;i++){
            if(a[i]==a[i+1]){
                count++;
                i++;
            }
        }
        System.out.println(count/2);
    }
}


import static java.lang.Math.*;
import static java.util.Arrays.*;
import java.util.*;
import java.io.*;

public class Main {

	void solve() {
		int n = sc.nextInt();
		int[] a = sc.nextIntArray(n);

		int[] count = new int[128];
		for (int i = 0; i < n; i++) { ++count[a[i]]; }

		int b = 0;
		for (int i = 0; i < count.length; i++) {
			b += count[i] / 2;
		}
		out.println(b / 2);
	}

	public static void main(String[] args) throws Exception {
		Class<?> here = new Object(){}.getClass().getEnclosingClass();
		try {
			String packageName = here.getPackage().getName();
			packageName = "src/" + packageName.replaceAll("\\.", "/") + "/";
			System.setIn(new FileInputStream(packageName + "input.txt"));
//			System.setOut(new PrintStream(new FileOutputStream(packageName + "output.txt")));
		} catch (FileNotFoundException e) {
		} catch (NullPointerException e) {
		}

		Object o = Class.forName(here.getName()).newInstance();
		o.getClass().getMethod("run").invoke(o);
	}

	static void tr(Object... os) {
		System.err.println(deepToString(os));
	}

	MyScanner sc = null;
	PrintWriter out = null;
	public void run() throws Exception {
		sc = new MyScanner(System.in);
		out = new PrintWriter(System.out);
		for (;sc.hasNext();) {
			solve();
			out.flush();
		}
		out.close();
	}

	void print(int[] a) {
		out.print(a[0]);
		for (int i = 1; i < a.length; i++) out.print(" " + a[i]);
		out.println();
	}

	class MyScanner {
		String line;
		BufferedReader reader;
		StringTokenizer tokenizer;

		public MyScanner(InputStream stream) {
			reader = new BufferedReader(new InputStreamReader(stream));
			tokenizer = null;
		}
		public void eat() {
			while (tokenizer == null || !tokenizer.hasMoreTokens()) {
				try {
					line = reader.readLine();
					if (line == null) {
						tokenizer = null;
						return;
					}
					tokenizer = new StringTokenizer(line);
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
			}
		}
		public String next() {
			eat();
			return tokenizer.nextToken();
		}
		public String nextLine() {
			try {
				return reader.readLine();
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
		}
		public boolean hasNext() {
			eat();
			return (tokenizer != null && tokenizer.hasMoreElements());
		}
		public int nextInt() {
			return Integer.parseInt(next());
		}
		public long nextLong() {
			return Long.parseLong(next());
		}
		public double nextDouble() {
			return Double.parseDouble(next());
		}
		public int[] nextIntArray(int n) {
			int[] a = new int[n];
			for (int i = 0; i < n; i++) a[i] = nextInt();
			return a;
		}
	}
}


import java.util.*;
public class CanvasFrames127B {
public static void main(String [] args)
{
    Scanner in=new Scanner(System.in);
    int number=in.nextInt();

    int [] sticks=new int[number];

    for(int i=0;i<number;i++){
        sticks[i]=in.nextInt();
    }

    Arrays.sort(sticks);
    int count=0;
    int temp=0;
    boolean done=false;
    while(!done){
        if(temp>=number-1){
            done=true;
        }
        else if(sticks[temp]==sticks[temp+1]){
            count++;
            temp+=2;
        }
        else if(sticks[temp]!=sticks[temp+1]){
            temp++;
        }
    }

    System.out.println(count/2);
}
}


import java.io.*;
import java.util.*;
public final class canvas_frames
{
    static FastScanner sc=new FastScanner(new BufferedReader(new InputStreamReader(System.in)));
    static PrintWriter out=new PrintWriter(System.out);
	static int maxn=101;

    public static void main(String args[]) throws Exception
    {
		int n=sc.nextInt();
		int[] a=new int[n],cnt=new int[maxn];
		int res=0;
		for(int i=0;i<n;i++)
		{
			a[i]=sc.nextInt();
			cnt[a[i]]++;
		}
		int c=0;
		for(int i=maxn-1;i>=0;)
		{
			if(cnt[i]>=4)
			{
				res++;
				cnt[i]-=4;
				continue;
			}
			else if(cnt[i]>=2)
			{
				if(c>0)
				{
					cnt[i]-=2;
					c=0;
					res++;
					continue;
				}
				else
				{
					c++;
					cnt[i]-=2;
					continue;
				}
			}
			i--;
		}
		out.println(res);
		out.close();
    }
}
class FastScanner
{
    BufferedReader in;
    StringTokenizer st;

    public FastScanner(BufferedReader in) {
        this.in = in;
    }

    public String nextToken() throws Exception {
        while (st == null || !st.hasMoreTokens()) {
            st = new StringTokenizer(in.readLine());
        }
        return st.nextToken();
    }

    public int nextInt() throws Exception {
        return Integer.parseInt(nextToken());
    }

    public long nextLong() throws Exception {
        return Long.parseLong(nextToken());
    }

    public double nextDouble() throws Exception {
        return Double.parseDouble(nextToken());
    }
}


import java.util.Arrays;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

public class B {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int []a = new int [n];
		for (int i = 0; i < a.length; i++) {
			a[i] = sc.nextInt();
		}
		Arrays.sort(a);
		int cnt = 0;
		int i = 0;
		while (i < a.length-3) {
			if (a[i] == a[i+1] && a[i+2] == a[i+3]){
				cnt++;
				i += 3;
			}
			i++;
		}
		System.out.println(cnt);
	}
}


import java.util.Arrays;
import java.util.Scanner;

public class B {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int []a = new int [n];
		for (int i = 0; i < a.length; i++) {
			a[i] = sc.nextInt();
		}
		int cnt = 0;
		boolean []f = new boolean [n];
		for (int i = 0; i < f.length; i++) {
			for (int j = i+1; j < f.length; j++) {
				if (a[i] == a[j] && !f[j] && !f[i]){
					cnt++;
					f[i] = f[j] = true;
					break;
				}
			}
		}
		System.out.println(cnt/2);
	}
}


import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

public class P127B_CanvasFrames {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		ArrayList<Integer> sticks = new ArrayList<>(n);

		for (int i = 0; i < n; i++) {
			sticks.add(scanner.nextInt());
		}

		scanner.close();
		Collections.sort(sticks);

		int index = 0;
		int couples = 0;

		while (index < n) {
			int length = sticks.get(index);
			int count = 1;
			int i = index + 1;

			while (i < n && sticks.get(i) == length) {
				i++;
				count++;
			}

			index = i;
			couples += count / 2;
		}

		int result = couples / 2;
		System.out.println(result);
	}
}


import java.io.*;
import java.util.*;

public class Main {
    Scanner in;
    PrintWriter out;

    void init() {
        Reader reader = new InputStreamReader(System.in);
        Writer writer = new OutputStreamWriter(System.out);
        BufferedReader bufferedReader = new BufferedReader(reader);
        BufferedWriter bufferedWriter = new BufferedWriter(writer);
        in = new Scanner(bufferedReader);
        out = new PrintWriter(bufferedWriter);
    }

    public static void main(String[] args) {
        new Main().run();
    }

    void run() {
        init();
        int n = in.nextInt();
        Map<Integer, Integer> map = new TreeMap<Integer, Integer>();
        for (int i = 0; i < n; ++i) {
            int num = in.nextInt();
            Integer old = map.get(num);
            if (old == null) {
                old = 0;
            }
            map.put(num, old + 1);
        }
        int ans = 0;
        for (Map.Entry<Integer, Integer> elem : map.entrySet()) {
            ans += elem.getValue() / 2;
        }
        out.println(ans / 2);
        out.flush();
    }
}


// Codeforces Beta Round #93
// Problem B -- Canvas Frames
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.BufferedReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class Main {
    public static void main(String args[]) {
        try {
            new Solver().run(new InputReader(System.in), new PrintWriter(System.out));
        } catch (IOException e) {
        }
    }
}

class Solver {
    void run(InputReader in, PrintWriter out) throws IOException {
        int n = in.nextInt();
        int[] count = new int[100];
        for (int i = 0; i < n; ++ i) {
            count[in.nextInt() - 1] ++;
        }
        int result = 0;
        for (int i = 0; i < 100; ++ i) {
            result += count[i] >> 1;
        }
        out.println(result >> 1);
        out.close();
    }
}

class InputReader {
    BufferedReader reader;
    StringTokenizer tokenizer;

    InputReader(InputStream in) {
        reader = new BufferedReader(new InputStreamReader(in));
        tokenizer = new StringTokenizer("");
    }

    String nextToken() throws IOException {
        while (!tokenizer.hasMoreTokens()) {
            tokenizer = new StringTokenizer(reader.readLine());
        }
        return tokenizer.nextToken();
    }

    int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }
}


import java.io.InputStreamReader;
import java.io.IOException;
import java.util.Arrays;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 * @author nasko
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskB solver = new TaskB();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskB {

    public void solve(int testNumber, InputReader in, PrintWriter out) {

        int n = in.nextInt();

        int[] arr = new int[n];
        int[] cnt = new int[101];
        Arrays.fill(cnt,0);

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

            arr[i] = in.nextInt();
            cnt[arr[i]]++;

        }

        int ret = 0;

        while(true) {
            boolean isFound = false;

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

                for(int j = i + 1; j < n; ++j) {
                    if(cnt[i] >= 2 && cnt[j] >= 2) {
                        cnt[i] -=2;
                        cnt[j] -=2;
                        isFound = true;
                        ++ret;
                    }
                }
            }
            if(!isFound) break;
        }
        for(int i = 0; i < n; ++i) {
            ret += cnt[i] / 4;
        }
        out.println(ret);

    }

}

class InputReader {
    public BufferedReader reader;
    public StringTokenizer tokenizer;

    public InputReader(InputStream stream) {
        reader = new BufferedReader(new InputStreamReader(stream));
        tokenizer = null;
    }

    public String next() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken();
    }

    public int nextInt() {
        return Integer.parseInt(next());
    }

}


import java.io.InputStreamReader;
import java.io.IOException;
import java.util.Arrays;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 * @author nasko
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskB solver = new TaskB();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskB {

    public void solve(int testNumber, InputReader in, PrintWriter out) {

        int n = in.nextInt();

        int[] arr = new int[n];
        int[] cnt = new int[101];
        Arrays.fill(cnt,0);

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

            arr[i] = in.nextInt();
            cnt[arr[i]]++;

        }

        int ret = 0;

        while(true) {
            boolean isFound = false;

            for(int i = 1; i <= 100; ++i) {

                for(int j = 1; j <= 100; ++j) {
                    if(i == j) continue;
                    if(cnt[i] >= 2 && cnt[j] >= 2) {
                        cnt[i] -=2;
                        cnt[j] -=2;
                        isFound = true;
                        ++ret;
                    }
                }
            }
            if(!isFound) break;
        }
        for(int i = 0; i <=100; ++i) {
            ret += cnt[i] / 4;
        }
        out.println(ret);

    }

}

class InputReader {
    public BufferedReader reader;
    public StringTokenizer tokenizer;

    public InputReader(InputStream stream) {
        reader = new BufferedReader(new InputStreamReader(stream));
        tokenizer = null;
    }

    public String next() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken();
    }

    public int nextInt() {
        return Integer.parseInt(next());
    }

}


import java.io.InputStreamReader;
import java.io.IOException;
import java.util.Arrays;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 * @author nasko
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskB solver = new TaskB();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskB {

    public void solve(int testNumber, InputReader in, PrintWriter out) {

        int n = in.nextInt();

        int[] arr = new int[n];
        int[] cnt = new int[101];
        Arrays.fill(cnt,0);

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

            arr[i] = in.nextInt();
            cnt[arr[i]]++;

        }

        int ret = 0;

        while(true) {
            boolean isFound = false;

            for(int i = 1; i <= 100; ++i) {

                for(int j = 1; j <= 100; ++j) {
                    if(i == j) continue;
                    if(cnt[i] >= 2 && cnt[j] >= 2) {
                        cnt[i] -=2;
                        cnt[j] -=2;
                        isFound = true;
                        ++ret;
                    }
                }
            }
            if(!isFound) break;
        }
        for(int i = 0; i < n; ++i) {
            ret += cnt[i] / 4;
        }
        out.println(ret);

    }

}

class InputReader {
    public BufferedReader reader;
    public StringTokenizer tokenizer;

    public InputReader(InputStream stream) {
        reader = new BufferedReader(new InputStreamReader(stream));
        tokenizer = null;
    }

    public String next() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken();
    }

    public int nextInt() {
        return Integer.parseInt(next());
    }

}


/*
 Author: Togrul Gasimov
 Mail: ttogrul30@gmail.com
 */

import java.util.Collection;
import java.util.Comparator;
import java.util.Locale;
import java.util.Scanner;
import java.util.Vector;
import java.util.Arrays;
import java.math.BigInteger;
import java.math.BigDecimal;
import java.util.List;
import java.util.Stack;

public class Main {

	static Scanner scan = new Scanner(System.in);

// Function begin
 static long f(long n){
	 long c;
	 double f1=(1+ Math.sqrt(5))/2,f2=(1-Math.sqrt(5))/2;
	 c=Math.round((Math.pow(f1, n) - Math.pow(f2, n))/Math.sqrt(5));
	 return c;
 }
//Function end

//variables begin
//static double PI=3.1415926535897932384626433832795,E=1e-9;
 static int n;
 static int[] a = new int[100000];

//variables end

static void read(){
  n=scan.nextInt();

  for(int i=1;i<=n;i++){
	  a[i]=scan.nextInt();
  }
}
static void solve(){

	Arrays.sort(a,1,n+1);
	int t=0,ans=0;
	for(int i=1;i<=n;i++){
		if(a[i]==a[i+1]){
			t++; i++;
		}
	}
   System.out.println(t/2);
}

public static void main(String[] args) {
  read();
  solve();
}
}


import java.util.*;
public class Frames
{
    static final int INF = Integer.MAX_VALUE;
    static final int NINF = Integer.MIN_VALUE;
    public static void exit()
    {
        System.exit(0);
    }
    public static void main(String[]args)
    {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int [] arr = new int[101];
        for(int i = 0; i < n; i++)
            arr[sc.nextInt()]++;

        int sum = 0;
        for(int i = 1; i <= 100; i++)
            sum += arr[i]/2;

        System.out.println(sum/2);

    }
}


import java.util.Scanner;

/**
 *
 * @author USUARIO
 */
public class Main {
    public static void main(String[] args) {
        Scanner input=new Scanner(System.in);
        int n;
        int[] array=new int[100];
        int sumador;
        do
        {
            sumador=0;
            n=input.nextInt();
            for (int i=0;i<n;i++)
                array[i]=input.nextInt();
            for (int i=0;i<n-1;i++)
            {
                for (int j=i+1; j<n  ;j++)
                {
                    if (array[j]==-1)
                        continue;
                    if (array[i]==array[j])
                    {
                        sumador++;
                        array[j]=-1;
                        break;
                    }
                }
            }
            System.out.println(sumador/2);
        }while(input.hasNext());
    }
}


import java.util.Arrays;
import java.util.Scanner;

public class Test127B {

	public Test127B() {}
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int N = scan.nextInt();
		int M[] = new int [N];
		for (int i = 0; i < N; i++)
			M[i] = scan.nextInt();
		Arrays.sort(M);
		int k = 0;
		for (int i = 0; i < N-1; i++)
			if(M[i] == M[i+1]) {
				k++;
				i++;
			}
		System.out.println(k/2);
	}
}


import java.util.Arrays;
import java.util.Scanner;

public class Test127B {

	public Test127B() {}
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int N = scan.nextInt();
		int M[] = new int [N];
		for (int i = 0; i < N; i++)
			M[i] = scan.nextInt();
		Arrays.sort(M);
		int k = 0;
		for (int i = 0; i < N; i++)
			if(M[i] == M[i+1]) {
				k++;
				i++;
			}
		System.out.println(k/2);
	}
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.StringTokenizer;

/**
 *
 * @author sukhdeep
 */
public class Test {

    public static void main(String ar[]) throws IOException {
        BufferedReader r = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(r.readLine());

        StringTokenizer str=new StringTokenizer(r.readLine());
       int a[]=new int[n];
for(int i=0;i<n;i++)
{
    a[i]=Integer.parseInt(str.nextToken());
}
Arrays.sort(a);int count=0;
for(int i=0;i<n-1;i++)
{
    if(a[i]==a[i+1])
    {
        count++;
        i++;
    }
}
System.out.println(count/2);
    }
}


import java.util.Scanner;

public class B127 {
    public static void main(String[] args) {
        int answer=0;
        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();
        int[] array = new int[101];
        for (int i=0;i<N;i++) {
            array[scanner.nextInt()]++;
        }
        scanner.close();

        int frame=0;
        for(int i=0;i<N;i++){
            if(array[i]!=0){
                if(array[i]>=4){
                    int cnt = log(array[i], 4);
                    answer+=cnt;
                    array[i]-=cnt;
                }if(array[i]>=2){
                    frame+=2;
                    array[i]-=2;
                }
                if(frame==4){
                    answer++;
                    frame = 0;
                }
            }

        }
        System.out.println(answer);
    }

    private static Integer log(int number,int base){
        return (int) (Math.log(number) / Math.log(base));
    }
}


import java.util.Scanner;

public class B127 {
    public static void main(String[] args) {
        int answer=0;
        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();
        int[] array = new int[101];
        for (int i=0;i<N;i++) {
            array[scanner.nextInt()]++;
        }
        scanner.close();

        int frame=0;
        for(int i=0;i<array.length;i++){
            if(array[i]!=0){
                if(array[i]>=4){
                    int cnt = array[i]/ 4;
                    answer+=cnt;
                    array[i]-=4*cnt;
                }if(array[i]>=2){
                    frame+=2;
                    array[i]-=2;
                }
                if(frame==4){
                    answer++;
                    frame = 0;
                }
            }

        }
        System.out.println(answer);
    }
}


import java.util.Scanner;

public class B127 {
    public static void main(String[] args) {
        int answer=0;
        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();
        int[] array = new int[101];
        for (int i=0;i<N;i++) {
            array[scanner.nextInt()]++;
        }
        scanner.close();

        int frame=0;
        for(int i=0;i<N;i++){
            if(array[i]!=0){
                if(array[i]>=4){
                    int cnt = log(array[i], 4);
                    answer+=cnt;
                    array[i]-=4*cnt;
                }if(array[i]>=2){
                    frame+=2;
                    array[i]-=2;
                }
                if(frame==4){
                    answer++;
                    frame = 0;
                }
            }

        }
        System.out.println(answer);
    }

    private static Integer log(int number,int base){
        return (int) (Math.log(number) / Math.log(base));
    }
}


import java.util.Scanner;

public class B127 {
    public static void main(String[] args) {
        int answer=0;
        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();
        int[] array = new int[101];
        for (int i=0;i<N;i++) {
            array[scanner.nextInt()]++;
        }
        scanner.close();

        int frame=0;
        for(int i=0;i<array.length;i++){
            if(array[i]!=0){
                if(array[i]>=4){
                    int cnt = log(array[i], 4);
                    answer+=cnt;
                    array[i]-=4*cnt;
                }if(array[i]>=2){
                    frame+=2;
                    array[i]-=2;
                }
                if(frame==4){
                    answer++;
                    frame = 0;
                }
            }

        }
        System.out.println(answer);
    }

    private static Integer log(int number,int base){
        return (int) (Math.log(number) / Math.log(base));
    }
}


import java.io.*;
import java.util.*;

/**
 *
 * @author Alejandro E. Garces
 */
public class Main{

   public static void main(String[] args) throws IOException{
         BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
         int n = Integer.parseInt(in.readLine());
         int[] sticks = new int[100 + 1];
         StringTokenizer st = new StringTokenizer(in.readLine());
         int sum = 0;
         for(int i = 0; i < n; i++)
             sticks[Integer.parseInt(st.nextToken())]++;
         for(int i = 0; i < 100; i++)
             sum += sticks[i]/2;

         System.out.println(sum/2);
         in.close();
         System.exit(0);
     }
}


import java.io.*;
import java.util.*;

/**
 *
 * @author Alejandro E. Garces
 */
public class Main{

   public static void main(String[] args) throws IOException{
         BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
         int n = Integer.parseInt(in.readLine());
         int[] sticks = new int[100];
         StringTokenizer st = new StringTokenizer(in.readLine());
         int sum = 0;
         for(int i = 0; i < n; i++)
             sticks[Integer.parseInt(st.nextToken())]++;
         for(int i = 0; i < 100; i++)
             sum += sticks[i]/2;

         System.out.println(sum/2);
         in.close();
         System.exit(0);
     }
}


import java.io.*;
import java.util.*;

/**
 *
 * @author Alejandro E. Garces
 */
public class Main{

   public static void main(String[] args) throws IOException{
         BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
         int n = Integer.parseInt(in.readLine());
         int[] sticks = new int[100 + 1];
         StringTokenizer st = new StringTokenizer(in.readLine());
         int sum = 0;
         for(int i = 0; i < n; i++)
             sticks[Integer.parseInt(st.nextToken())]++;
         for(int i = 0; i <= 100; i++)
             sum += sticks[i]/2;

         System.out.println(sum/2);
         in.close();
         System.exit(0);
     }
}


#include<bits/stdc++.h>
using namespace std;

int main()
{
    long long int i,j,x=0,res=0,t,a;
    map<int,int>n;

    cin>>t;

    for(i=0; i<t; i++)
    {
        cin>>a;
        n[a]++;
    }

   for(i=0; i<=100; i++){

         cout<<n[i];
         x+=(n[i]/2);
    }

     cout<<x/2;

     return 0;
}


#include<bits/stdc++.h>
using namespace std;

int main()
{
    long long int i,j,x=0,res=0,t,a;
    map<int,int>n;

    cin>>t;

    for(i=0; i<t; i++)
    {
        cin>>a;
        n[a]++;
    }

   for(i=0; i<=100; i++){

//         cout<<n[i];
         x+=(n[i]/2);
    }

     cout<<x/2;

     return 0;
}


#include<bits/stdc++.h>
using namespace std;

int main()
{
    int i,j,x=0,res=0,t,a;
    map<int,int>n;

    cin>>t;

    for(i=0; i<t; i++)
    {
        cin>>a;

        n[a]++;
    }

   for(i=0; i<t; i++)
         x+=(n[i]/2);

     cout<<x/2;

     return 0;
}


#include <iostream>
#include <fstream>
#include <cmath>
#include <iomanip>
#include <vector>
#include <algorithm>

using namespace std;

int main() {
	//cout << fixed << setprecision(6);
	//freopen("Text.txt", "r", stdin);
	int n;
	cin >> n;
	int ans = 0;
	vector<int> vct(101);
	for (int i = 0; i < n; i++) {
		int temp;
		cin >> temp;
		vct[temp]++;
	}

	for (int i = 1; i < 101; i++)
	{
		if (vct[i] > 1)
		for (int j = i + 1; j < 101; j++)
		{
			if (vct[j] > 1)
				{
					vct[i] -= 2;
					vct[j] -= 2;
					ans++;
					if (vct[i] < 2)	break;
				}
		}
	}

	for (auto now : vct) {
		if (now >= 4) ans += now / 4;
	}
	cout << ans;
	return 0;

}


#include <iostream>
#include <fstream>
#include <cmath>
#include <iomanip>
#include <vector>
#include <algorithm>

using namespace std;

int main() {
	//cout << fixed << setprecision(6);
	//freopen("Text.txt", "r", stdin);
	int n;
	cin >> n;
	int ans = 0;
	vector<int> vct(101);
	for (int i = 0; i < n; i++) {
		int temp;
		cin >> temp;
		vct[temp]++;
	}

	for (auto now : vct) {
		ans += now / 2;
	}
	cout << ans/2;
	return 0;

}


#include <iostream>
#include <fstream>
#include <cmath>
#include <iomanip>
#include <vector>
#include <algorithm>

using namespace std;

int main() {
	//cout << fixed << setprecision(6);
	//freopen("Text.txt", "r", stdin);
	int n;
	cin >> n;
	int ans = 0;
	vector<int> vct(101);
	for (int i = 0; i < n; i++) {
		int temp;
		cin >> temp;
		vct[temp]++;
	}

	for (int i = 1; i < 101; i++)
	{
		if (vct[i] > 1)
		for (int j = i + 1; j < 101; j++)
		{
			if (vct[j] > 1)
				{
					vct[i] -= 2;
					vct[j] -= 2;
					ans++;
					if (vct[i] < 2)	break;
				}
		}
	}
	cout << ans;
	return 0;
}


#include<iostream>
using namespace std;
int main()
{
int n,c=0,k,v[100]={0},i;
cin>>n;
for(i=0;i<n;i++)
{
cin>>k;
v[k]++;
if(v[k]%2==0)
c++;
}
cout<<c/2;
return 0;
}


#include<iostream>
using namespace std;
int main()
{
int n,c=0,k,x[100]={0},i;
cin>>n;
for(i=0;i<n;i++)
{
cin>>k;
x[k]++;
if(x[k]%2==0)
c++;
}
cout<<c/2;
}


#include<iostream>
using namespace std;
int main()
{
int n,c=0,k,v[100]={0},i;
cin>>n;
for(i=0;i<n;i++)
{
cin>>k;
v[k]++;
if(v[k]%2==0)
c++;
}
cout<<c/4;
return 0;
}


#include<bits/stdc++.h>
using namespace std;

main(){
    int n;
    set < int > st;
    int freq[110] = {0};

    scanf("%d" , &n);

    int x;
    for(int i = 0 ; i < n ; i ++){
        scanf("%d" , &x);
        freq[x] ++;
        st.insert(x);
    }

    int ans = 0;
    for(auto S : st){

        for(auto S2 : st){
            if(S == S2)continue;
            int tmp = min(freq[S] , freq[S2]);
            tmp -= tmp&1;
            ans += tmp / 2;
            freq[S]  -= tmp;
            freq[S2] -= tmp;
        }
    }

    for(auto S : st){
        ans += freq[S] / 4;
    }

    printf("%d\n" , ans);
}


#include<bits/stdc++.h>
using namespace std;

main(){
    int n;
    int freq[110] = {0};

    scanf("%d" , &n);

    int x;
    for(int i = 0 ; i < n ; i ++){
        scanf("%d" , &x);
        freq[x] ++;
    }

    int ans = 0;
    for(int i = 1 ; i <= 100 ; i ++)ans += freq[i] / 2;

    printf("%d\n" , ans / 2);
}


#include<bits/stdc++.h>
#include<algorithm>
using namespace std;
#include<stdio.h>
#include<string.h>
//#define max(a,b) (a>b)?a:b
#define N 10000000
#define ll long long
int a[N],b[N];
int main()
{
    char ch[N];
    int i,n,k=0,m,t=0,j=0;
    cin>>n;
    for(i=1;i<=n;i++)
    {
        cin>>m;
        a[m]++;
        j=max(j,m);
        //cout<<j<<" ";
    }
    for(i=1;i<=j;i++)
    {
         if(a[i]>=4)
            {
               k+=(a[i]/4);

               a[i]=a[i]-(a[i]/4);
            }
            if(a[i]>=2)
            {
                  t+=2;
                  a[i]-=2;
            }
            if(t==4)
            {
                  t=0;
                  k++;
            }
           // cout<<t<<"\n";
    }
    cout<<k;
    return 0;
}


#include<bits/stdc++.h>
#include<algorithm>
using namespace std;
#include<stdio.h>
#include<string.h>
//#define max(a,b) (a>b)?a:b
#define N 10000000
#define ll long long
int a[N],b[N];
int main()
{
    char ch[N];
    int i,n,k=0,m,t=0,j=0;
    cin>>n;
    for(i=1;i<=n;i++)
    {
        cin>>m;
        a[m]++;
        j=max(j,m);
       // cout<<j<<" ";
    }
    for(i=1;i<=j;i++)
    {
         if(a[i]>=4)
            {
               k+=(a[i]/4);

               a[i]=a[i]-4*(a[i]/4);
            }
            if(a[i]>=2)
            {
                  t+=2;
                  a[i]-=2;
            }
            if(t==4)
            {
                  t=0;
                  k++;
            }
            //cout<<t<<"\n";
    }
    cout<<k;
    return 0;
}


/* -*- coding: utf-8; tab-width: 4 -*- */

#include <cstdio>

int
main()
{
	int n, a, r(0);
	bool f[101] = {};

	std::scanf("%d", &n);
	while (0 < n--) {
		std::scanf("%d", &a);
		r += f[a];
		f[a] = !f[a];
	}

	std::printf("%d\n", r / 2);

	return 0;
}