ll@n,b[2d5]{}; rep(n){ll@a;++b[a];} ll i=0; while(b[i]>=2)++i; if(b[i]==1){ ++i; while(b[i]>=2)++i; } wt(min(i,n/2));