import Data.List
main=do
 n<-readLn
 s<-words<$>getLine
 let a=sortOn(length).group$[x|(i,x)<-zip[0..]s,even i]
 let b=sortOn(length).group$[x|(i,x)<-zip[0..]s,odd i]
 let u=length$a!!0
 let v=length$b!!0
 print.minimum$[n-(if a!!0!!0/=b!!0!!0 then u+v else 0),n-u-if 1<length b then length$b!!1 else 0,n-v-if 1<length a then length$a!!1 else 0]