_ = eval(input())

seq = list(map(int,input().split()))

 

seq1 = seq[::2]

seq2 = seq[1::2]

 

if len(set(seq)) == 1:

    print((len(seq2)))

    exit()

    

def count_dictonary(seq):

    ret_dict={}

    for item in seq:

        if item not in ret_dict:

            ret_dict[item] = 1

        else:

            ret_dict[item]+=1

    return ret_dict

 

def modes(counting_dict):

    #(11,2),(2,1),(3,3)

    ret={}

    for item in list(counting_dict.items()):

        no, count = item

        if counting_dict[no] in ret:

            ret[count].append(no)

        else:

            ret[count]=[no]

            

    return ret

 

 

counting1 = count_dictonary(seq1)

counting2 = count_dictonary(seq2)

 

modes1 = sorted(list(modes(counting1).items()),reverse=True)

modes2 = sorted(list(modes(counting2).items()),reverse=True)

 

min_change=len(seq)

if modes1[0][1] != modes2[0][1] or len(modes1[0][1]) >=2 or len(modes2[0][1]) >=2:

    min_change = (len(seq1) - modes1[0][0]) + (len(seq2) - modes2[0][0])

else:

    m01=len(seq)

    m10=len(seq)

    if len(modes2) !=1:

        m01 =  (len(seq1) - modes1[0][0]) + (len(seq2) - modes2[1][0])

    if len(modes1) !=1:

        m10 =  (len(seq1) - modes1[1][0]) + (len(seq2) - modes2[0][0])

    min_change = min(m01,m10)

    

print(min_change)
def count_char_occurrence(seq):

    # count how many times characters occur and return results as a dictionary

    ret = {}

    for char in seq:

        if char in ret:

            ret[char] += 1

        else:

            ret[char] = 1

    return ret





def accum_char_frequency(seq):

    """

    accumulate frequency of each number in a inputted sequence

    Example:

        in: [a,a,a,a,b,b,b,b,c]

        out: { 4 times: [a,b] , 1 times: [c] }

    """

    frequencies = count_char_occurrence(seq)



    ret = {}

    for char, count in list(frequencies.items()):

        if count in ret:

            ret[count].append(char)

        else:

            ret[count] = [char]

    return ret





def main():

    _ = eval(input())

    seq = list(map(int, input().split()))



    odd = seq[::2]

    even = seq[1::2]



    if len(set(seq)) == 1:  # when all chars are unique, return the length of even numbered chars

        print((len(even)))

        return



    no_freq_odd = accum_char_frequency(odd)

    freq_odd = sorted(list(no_freq_odd.items()), reverse=True)

    

    no_freq_even = accum_char_frequency(even)

    freq_even = sorted(list(no_freq_even.items()), reverse=True)



    if len(freq_odd[0][1]) == 1 and len(freq_even[0][1]) == 1 and freq_odd[0][1] == freq_even[0][1]:

        min_change_even = len(seq)

        if len(freq_even) != 1:

            min_change_even = (len(odd) - freq_odd[0][0]) + (len(even) - freq_even[1][0])



        min_change_odd = len(seq)

        if len(freq_odd) != 1:

            min_change_odd = (len(odd) - freq_odd[1][0]) + (len(even) - freq_even[0][0])



        print((min(min_change_even, min_change_odd)))

        return

    else:

        min_change = (len(odd) - freq_odd[0][0]) + (len(even) - freq_even[0][0])

        print(min_change)

        return



main()
_ = eval(input())
seq = list(map(int, input().split()))
seq1 = seq[::2]
seq2 = seq[1::2]
if len(set(seq)) == 1:
    print((len(seq2)))
    exit()


def count_dictonary(seq):
    ret_dict = {}
    for item in seq:
        if item not in ret_dict:
            ret_dict[item] = 1
        else:
            ret_dict[item] += 1
    return ret_dict


def modes(counting_dict):
    # (11,2),(2,1),(3,3)
    ret = {}
    for item in list(counting_dict.items()):
        no, count = item
        if counting_dict[no] in ret:
            ret[count].append(no)
        else:
            ret[count] = [no]
    return ret


counting1 = count_dictonary(seq1)
counting2 = count_dictonary(seq2)
modes1 = sorted(list(modes(counting1).items()), reverse=True)
modes2 = sorted(list(modes(counting2).items()), reverse=True)
min_change = len(seq)
if modes1[0][1] != modes2[0][1] or len(modes1[0][1]) >= 2 or len(modes2[0][1]) >= 2:
    min_change = (len(seq1) - modes1[0][0]) + (len(seq2) - modes2[0][0])
else:
    m01 = len(seq)
    m10 = len(seq)
    if len(modes2) != 1:
        m01 = (len(seq1) - modes1[0][0]) + (len(seq2) - modes2[1][0])
    if len(modes1) != 1:
        m10 = (len(seq1) - modes1[1][0]) + (len(seq2) - modes2[0][0])
    min_change = min(m01, m10)
print(min_change)

def count_char_occurrence(seq):
    # count how many times characters occur and return results as a dictionary
    ret = {}
    for char in seq:
        if char in ret:
            ret[char] += 1
        else:
            ret[char] = 1
    return ret


def accum_char_frequency(seq):
    """
    accumulate frequency of each number in a inputted sequence
    Example:
        in: [a,a,a,a,b,b,b,b,c]
        out: { 4 times: [a,b] , 1 times: [c] }
    """
    frequencies = count_char_occurrence(seq)
    ret = {}
    for char, count in list(frequencies.items()):
        if count in ret:
            ret[count].append(char)
        else:
            ret[count] = [char]
    return ret


def main():
    _ = eval(input())
    seq = list(map(int, input().split()))
    odd = seq[::2]
    even = seq[1::2]
    if (
        len(set(seq)) == 1
    ):  # when all chars are unique, return the length of even numbered chars
        print((len(even)))
        return
    no_freq_odd = accum_char_frequency(odd)
    freq_odd = sorted(list(no_freq_odd.items()), reverse=True)
    no_freq_even = accum_char_frequency(even)
    freq_even = sorted(list(no_freq_even.items()), reverse=True)
    if (
        len(freq_odd[0][1]) == 1
        and len(freq_even[0][1]) == 1
        and freq_odd[0][1] == freq_even[0][1]
    ):
        min_change_even = len(seq)
        if len(freq_even) != 1:
            min_change_even = (len(odd) - freq_odd[0][0]) + (
                len(even) - freq_even[1][0]
            )
        min_change_odd = len(seq)
        if len(freq_odd) != 1:
            min_change_odd = (len(odd) - freq_odd[1][0]) + (len(even) - freq_even[0][0])
        print((min(min_change_even, min_change_odd)))
        return
    else:
        min_change = (len(odd) - freq_odd[0][0]) + (len(even) - freq_even[0][0])
        print(min_change)
        return


main()

-_ = eval(input()) -seq = list(map(int, input().split())) -seq1 = seq[::2] -seq2 = seq[1::2] -if len(set(seq)) == 1: -    print((len(seq2))) -    exit() - - -def count_dictonary(seq): -    ret_dict = {} -    for item in seq: -        if item not in ret_dict: -            ret_dict[item] = 1 +def count_char_occurrence(seq): +    # count how many times characters occur and return results as a dictionary +    ret = {} +    for char in seq: +        if char in ret: +            ret[char] += 1 -            ret_dict[item] += 1 -    return ret_dict - - -def modes(counting_dict): -    # (11,2),(2,1),(3,3) -    ret = {} -    for item in list(counting_dict.items()): -        no, count = item -        if counting_dict[no] in ret: -            ret[count].append(no) -        else: -            ret[count] = [no] +            ret[char] = 1 -counting1 = count_dictonary(seq1) -counting2 = count_dictonary(seq2) -modes1 = sorted(list(modes(counting1).items()), reverse=True) -modes2 = sorted(list(modes(counting2).items()), reverse=True) -min_change = len(seq) -if modes1[0][1] != modes2[0][1] or len(modes1[0][1]) >= 2 or len(modes2[0][1]) >= 2: -    min_change = (len(seq1) - modes1[0][0]) + (len(seq2) - modes2[0][0]) -else: -    m01 = len(seq) -    m10 = len(seq) -    if len(modes2) != 1: -        m01 = (len(seq1) - modes1[0][0]) + (len(seq2) - modes2[1][0]) -    if len(modes1) != 1: -        m10 = (len(seq1) - modes1[1][0]) + (len(seq2) - modes2[0][0]) -    min_change = min(m01, m10) -print(min_change) +def accum_char_frequency(seq): +    """ +    accumulate frequency of each number in a inputted sequence +    Example: +        in: [a,a,a,a,b,b,b,b,c] +        out: { 4 times: [a,b] , 1 times: [c] } +    """ +    frequencies = count_char_occurrence(seq) +    ret = {} +    for char, count in list(frequencies.items()): +        if count in ret: +            ret[count].append(char) +        else: +            ret[count] = [char] +    return ret + + +def main(): +    _ = eval(input()) +    seq = list(map(int, input().split())) +    odd = seq[::2] +    even = seq[1::2] +    if ( +        len(set(seq)) == 1 +    ):  # when all chars are unique, return the length of even numbered chars +        print((len(even))) +        return +    no_freq_odd = accum_char_frequency(odd) +    freq_odd = sorted(list(no_freq_odd.items()), reverse=True) +    no_freq_even = accum_char_frequency(even) +    freq_even = sorted(list(no_freq_even.items()), reverse=True) +    if ( +        len(freq_odd[0][1]) == 1 +        and len(freq_even[0][1]) == 1 +        and freq_odd[0][1] == freq_even[0][1] +    ): +        min_change_even = len(seq) +        if len(freq_even) != 1: +            min_change_even = (len(odd) - freq_odd[0][0]) + ( +                len(even) - freq_even[1][0] +            ) +        min_change_odd = len(seq) +        if len(freq_odd) != 1: +            min_change_odd = (len(odd) - freq_odd[1][0]) + (len(even) - freq_even[0][0]) +        print((min(min_change_even, min_change_odd))) +        return +    else: +        min_change = (len(odd) - freq_odd[0][0]) + (len(even) - freq_even[0][0]) +        print(min_change) +        return + + +main()