x,s,a[1<<17],*p=a;c(int*a,int*b){x=*a-*b;}main(){for(;~scanf("%d",p);p++);for(qsort(a+1,p-a,4,c);--p-a;s+=*p-p[1]&&p[1]-p[2]);s=!printf("%d",s);}