using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

class Program {
    static void Main(string[] args) {
        int n = int.Parse(Console.ReadLine());
        int[] v = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();

        //偶数番目の要素を取り出した配列
        int[] odd = v.ToList().Where((name, index) => index % 2 == 0).ToArray();
        //奇数番目の要素を取り出した配列
        int[] even = v.ToList().Where((name, index) => index % 2 == 1).ToArray();

        //重複している数字の個数を出す
        var duplicationList_Odd = odd
                             .ToList()
                             .GroupBy(x => x)
                             .Where(g => g.Count() >= 1)
                             .Select(g => new { number = g.Key, duplicationCount = g.Count() })
                             .ToList();
        var duplicationList_Even = even
                             .ToList()
                             .GroupBy(x => x)
                             .Where(g => g.Count() >= 1)
                             .Select(g => new { number = g.Key, duplicationCount = g.Count() })
                             .ToList();

        //これらを、duplicdationCountが降順になるように並び替える
        var orderByDesList_Odd = duplicationList_Odd
                                       .OrderByDescending(g => g.duplicationCount);
        var orderByDesList_Even = duplicationList_Even
                                       .OrderByDescending(g => g.duplicationCount);

        //解答(数字がかぶっていて、変える必要のない数字の個数)
        int chofuku = 0;
        
        //奇数番目で一番よく使われている数字と、偶数番目で一番よく使われている数字が違うとき→カンタン！
        if (orderByDesList_Odd.First().number != orderByDesList_Even.First().number) {
            chofuku = orderByDesList_Odd.First().duplicationCount + orderByDesList_Even.First().duplicationCount;
            //Console.WriteLine("1");
        //奇数番目で一番よく使われている数字と、偶数番目で一番よく使われている数字が同じとき→場合分け複雑！
        } else {
            //奇数番目も偶数番目も、ともに一種類しかないとき
            if (orderByDesList_Even.ToArray().Length == 1 && orderByDesList_Odd.ToArray().Length == 1) {
                chofuku = odd.Length;
            //偶数番目のみが一種類のとき
            } else if (orderByDesList_Even.ToArray().Length == 1) {
                chofuku = orderByDesList_Odd.ToArray()[1].duplicationCount;
            //奇数番目のみが一種類のとき
            } else if (orderByDesList_Odd.ToArray().Length == 1) {
                chofuku = orderByDesList_Even.ToArray()[1].duplicationCount;
            //どちらも二種類以上あるとき
            } else {
                chofuku = Math.Max(orderByDesList_Even.ToArray()[0].duplicationCount + orderByDesList_Odd.ToArray()[1].duplicationCount, orderByDesList_Even.ToArray()[1].duplicationCount + orderByDesList_Odd.ToArray()[0].duplicationCount);
            }
        }
            
        //    (orderByDesList_Odd.First().number == orderByDesList_Even.First().number) {
        //    if (orderByDesList_Even.ToArray().Length >= 2) {
        //        choufuku = orderByDesList_Odd.First().duplicationCount + orderByDesList_Even.ToArray()[1].duplicationCount;
        //        //Console.WriteLine("2");
        //    } else {
        //        choufuku = orderByDesList_Odd.First().duplicationCount;
        //        //Console.WriteLine("3");
        //    }
        //} else if (orderByDesList_Odd.First().number < orderByDesList_Even.First().number) {
        //    if (orderByDesList_Odd.ToArray().Length >= 2) {
        //        choufuku = orderByDesList_Odd.ToArray()[1].duplicationCount + orderByDesList_Even.First().duplicationCount;
        //        //Console.WriteLine("4");
        //    } else {
        //        choufuku = orderByDesList_Even.First().duplicationCount;
        //        //Console.WriteLine("5");
        //    }
        //}

        //出力
        Console.WriteLine(n - chofuku);
    }
}

Measured memory_bytes: 45228