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