n = gets.to_i
v = gets.chomp.split.map(&:to_i)
odd = Hash.new(0)
even = Hash.new(0)

(n / 2).times do |i|
  even[v[2 * i]] += 1
  odd[v[2 * i + 1]] += 1
end

ep = even.to_a.sort_by! {|_, v| v }
op = odd.to_a.sort_by! {|_, v| v }

ev = ep[-1][1]
ov = op[-1][1]

if ev == n / 2 && ov == n / 2
  puts (ep[-1][0] == op[-1][0])? n / 2 : "0"
elsif ev != ov
  puts n / 2 - [ev, ov].min
else
  puts n - [ep[-2][1] + ov, ev + op[-2][1]].max
end