#![allow(unused_parens)]
#![allow(unused_imports)]
#![allow(non_upper_case_globals)]


macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let mut s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };

    ($next:expr, [$t:tt]) => {
        {
            let len = read_value!($next, usize);
            (0..len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
        }
    };
    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}


#[cfg(debug_assertions)]
macro_rules! mydbg {
    //($arg:expr) => (dbg!($arg))
    ($arg:expr) => (println!("{:?}",$arg));
}


#[cfg(not(debug_assertions))]
macro_rules! mydbg {
    ($($arg:expr),*) => {};
}


use std::cmp;
use std::collections::HashMap;


static INF_I64 :i64 = 9223372036854775807;
static INF_I32 : i32 = 2147483647;
static INF_USIZE : usize = 18446744073709551615;




fn main() {

    input! { 
       n: usize,
       v : [i64;n],
    }

    let mut ans = 0;
    let mut a = vec![0;n/2];
    let mut b = vec![0;n/2];
    let mut a1 = std::collections::HashMap::new();
    let mut b1 = std::collections::HashMap::new();

    let mut index = 0;
    while(true){
        if index >= n { break;};
        
        a[index/2] = v[index];
        b[index/2] = v[index+1];

        let mut c = a1.entry(a[index/2]).or_insert(0_usize);
        *c+=1;
        let mut c2 = b1.entry(b[index/2]).or_insert(0_usize);
        *c2+=1;

        index+=2;
    }

  
  

    let mut ac = vec![(0,0);n/2];
    let mut bc = vec![(0,0);n/2];
    let mut index = 0;
    for item in a1.iter(){
        ac[index] = (*item.0, *item.1);
        index+=1;

    }
    let mut index = 0;
    for item in b1.iter(){
        bc[index] = (*item.0, *item.1);
        index+=1;

    }

    ac.sort_by_key(|x|{return x.1});
    bc.sort_by_key(|x|{return x.1});
    ac.reverse();
    bc.reverse();

    mydbg!(ac);
    mydbg!(bc);

    ans = n - ac[0].1 - bc[0].1;

    if(ac[0].0 == bc[0].0){
        let av = ac[0].1;
        let bv = bc[0].1;
        ans = INF_USIZE;
        ac.remove(0);
        bc.remove(0);
        ans = cmp::min(ans , n - av - bc[0].1);
        ans = cmp::min(ans , n - bv - ac[0].1);
        
    }


    
    
    println!("{}",ans);


}


Measured memory_bytes: 14588