Scanf.(Array.(let s,q,a,c,f,d=(fun f->Scanf.scanf" %d"f),(fun _->make 100005(0,0)),(fun a i->a.(i)<-fst a.(i)+1,i),(fun u v->compare v u),fst,snd in s@@fun n->let e,o=init n(fun i->s@@fun v->i,v)|>fold_left(fun(e,o)(i,v)->(if i mod 2=0 then a e v else a o v);e,o)(q 0,q 0)in sort c e;sort c o;print_int@@n-(if d e.(0)=d o.(0)then max(f e.(0)+f o.(1))(f e.(1)+f o.(0))else(f e.(0)+f o.(0)));0,0))