#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; typedef unsigned long long ull; #define FOR(i,a,b) for(int i=(a);i<(b);i++) #define REP(i,n) FOR(i,0,n) #define CLEAR(d) memset((d), 0, (sizeof((d)))) #define ALL(c) (c).begin(), (c).end() #define ABS(x) ((x < 0) ? -(x) : (x)) #define SORT(x) sort((x).begin(), (x).end()) #define RSORT(x) sort((x).begin(), (x).end(), greater() ) #define SIZE(a) ((int)((a).size())) #define MAX3(a, b, c) (max(max((a), (b)), (c))) #define MIN3(a, b, c) (min(min((a), (b)), (c))) #define MOD 1000000007 #define EPS 1e-5 #define PI (acos(-1)) #define INF 10000000 //=================================================== int main() { int n, a, item[10], ans = 0; CLEAR(item); cin >> n; REP(i, n*3) { cin >> a; item[a-1]++; if (item[a-1] >= 2) { ans++; item[a-1] -= 2; } } int sum = 0; REP(i, 10) { sum += item[i]; } ans += sum / 4; printf("%d\n", ans); return 0; }