#include int main(void){ int i,j,n,t,k,r = 0,c,a[16][131072] = {0},ap[16] = {0},al[131072],bl[131072],blc=0,con; scanf("%d",&n); for(i = 1;i <= n;i++){ scanf("%d",&t); al[i] = t; k = t % 10; a[k][(ap[k])] = t; ap[k]++; } for(i = 1;i <= n;i++){ con = 0; k = al[i] % 10; c = 0; for(j = 0;j < blc;j++){ if(bl[j] == al[i]){con++;break;} } if(con){continue;} for(j = 0;j < ap[k];j++){ if(al[i] == a[k][j]){c++;} } if(c == 1){r++;} else{bl[blc] = al[i];blc++;} } printf("%d\n",r); return 0; }