using System;
using System.Collections.Generic;
using System.Linq;
using BitArray = System.Collections.BitArray;
using BigInteger = System.Numerics.BigInteger;

namespace AtCoderProject
{
    public class Program
    {
        public object Calc()
        {
            //var line = consoleReader.SplitInt32();
            var N = consoleReader.Int32();
            var vs = consoleReader.SplitInt32();

            var evens = new Dictionary<int, int>();
            var odds = new Dictionary<int, int>();

            for (int i = 0; i < N; i += 2)
            {
                if (evens.ContainsKey(vs[i]))
                    evens[vs[i]]++;
                else
                    evens.Add(vs[i], 1);
                if (odds.ContainsKey(vs[i + 1]))
                    odds[vs[i + 1]]++;
                else
                    odds.Add(vs[i + 1], 1);
            }

            var sortedEvens = evens.OrderByDescending(p => p.Value).ToArray();
            var sortedOdds = odds.OrderByDescending(p => p.Value).ToArray();

            if (sortedEvens.Length == 1 && sortedOdds.Length == 1)
            {
                if (sortedEvens[0].Key == sortedOdds[0].Key)
                {
                    return sortedEvens[0].Value;
                }
                else return 0;
            }


            if (sortedEvens[0].Key == sortedOdds[0].Key)
            {
                if (sortedEvens.Length == 1)
                {
                    return N / 2 - sortedOdds[1].Value;
                }
                if (sortedOdds.Length == 1)
                {
                    return N / 2 - sortedEvens[1].Value;
                }
                if (sortedOdds[1].Value > sortedEvens[1].Value)
                    return N - sortedOdds[1].Value- sortedEvens[0].Value;
                else
                    return N - sortedOdds[0].Value - sortedEvens[1].Value;
            }

            return N - sortedOdds[0].Value - sortedEvens[0].Value;
        }

        public const int mod = 1000000007;
        private readonly ConsoleReader consoleReader;
        public Program() : this(new ConsoleReader()) { }
        public Program(ConsoleReader consoleReader) { this.consoleReader = consoleReader; }
        static void Main() => Console.WriteLine(new Program().Calc());
        public static string MultiLine<T>(IEnumerable<T> source) => string.Join("\n", source);
    }

    public class ConsoleReader { public virtual string String() => Console.ReadLine(); public int Int32() => int.Parse(String()); public long Int64() => long.Parse(String()); public ulong UInt64() => ulong.Parse(String()); public double Double() => double.Parse(String()); public string[] Split() => String().Split().ToArray(); public int[] SplitInt32() => String().Split().Select(int.Parse).ToArray(); public long[] SplitInt64() => String().Split().Select(long.Parse).ToArray(); public ulong[] SplitUInt64() => String().Split().Select(ulong.Parse).ToArray(); public double[] SplitDouble() => String().Split().Select(double.Parse).ToArray(); public IEnumerable<string> Repeat(int count) { for (int i = 0; i < count; i++) yield return String(); } public IEnumerable<int> RepeatInt32(int count) { for (int i = 0; i < count; i++) yield return Int32(); } public IEnumerable<long> RepeatInt64(int count) { for (int i = 0; i < count; i++) yield return Int64(); } public IEnumerable<string[]> RepeatSplit(int count) { for (int i = 0; i < count; i++) yield return Split(); } public IEnumerable<int[]> RepeatSplitInt32(int count) { for (int i = 0; i < count; i++) yield return SplitInt32(); } }
}

Measured memory_bytes: 29408