Module Module1

    Sub Main()
        Dim n As Integer = CInt(Console.ReadLine())
        Dim input() As String = Split(Console.ReadLine())

        Dim dict1 As New Dictionary(Of String, Integer)
        Dim dict2 As New Dictionary(Of String, Integer)
        Dim many1_1 As New KeyValuePair(Of String, Integer)("0", 0)
        Dim many1_2 As New KeyValuePair(Of String, Integer)("0", 0)
        Dim many2_1 As New KeyValuePair(Of String, Integer)("0", 0)
        Dim many2_2 As New KeyValuePair(Of String, Integer)("0", 0)

        Dim cnt As Integer = 0
        For Each i In input
            If cnt Mod 2 = 0 Then
                If dict1.ContainsKey(i) Then
                    dict1(i) = dict1(i) + 1
                Else
                    dict1(i) = 1
                End If

                If dict1(i) > many1_1.Value Then
                    If i <> many1_1.Key Then
                        many1_2 = many1_1
                    End If
                    many1_1 = New KeyValuePair(Of String, Integer)(i, dict1(i))

                ElseIf dict1(i) > many1_2.Value Then
                    many1_2 = New KeyValuePair(Of String, Integer)(i, dict1(i))
                End If
            Else
                If dict2.ContainsKey(i) Then
                    dict2(i) = dict2(i) + 1
                Else
                    dict2(i) = 1
                End If

                If dict2(i) > many2_1.Value Then
                    If i <> many1_1.Key Then
                        many2_2 = many2_1
                    End If
                    many2_1 = New KeyValuePair(Of String, Integer)(i, dict2(i))
                    ElseIf dict2(i) > many2_2.Value Then
                        many2_2 = New KeyValuePair(Of String, Integer)(i, dict2(i))
                End If
            End If
            cnt += 1
        Next

        If many1_1.Key <> many2_1.Key Then
            Console.WriteLine((n / 2 - many1_1.Value) + (n / 2 - many2_1.Value))
        Else
            If many1_1.Value = n / 2 AndAlso many2_1.Value = n / 2 Then
                Console.WriteLine(n / 2)
            Else
                Console.WriteLine(Math.Min((n / 2 - many1_1.Value) + (n / 2 - many2_2.Value), (n / 2 - many1_2.Value) + (n / 2 - many2_1.Value)))
            End If
        End If
    End Sub
End Module
