////#include <bits/stdc++.h>
////
////using namespace std;
////
////int main() {
////    int n,k;
////    while(cin >> n >> k){
////            if(n % k) cout << 1 << endl;
////    else cout << 0 << endl;
//////        cout << n / k - n % k << endl;
////    }
////    return 0;
////}
//
////
////#include <bits/stdc++.h>
////
////using namespace std;
////
////const int maxn = 200000;
////bool vis[maxn];
////int main() {
////    int n;
////    while(cin >> n) {
////        memset(vis,0,sizeof(vis));
////        for(int i = 0; i < 100; i++) {
////            int sum = i * 4;
////            for(int j = 0; j < 100; j++) {
////                sum += j * 7;
////                vis[sum] = 1;
////            }
////        }
////    if(vis[n]) printf("Yes\n");
////    else printf("No\n");
////    }
////    return 0;
////}
//
//
//
////
////
////#include <bits/stdc++.h>
////
////using namespace std;
////
////const int maxn = 200000;
////bool vis[maxn];
////long long s[maxn];
////long long n;
////
////int main() {
////    int n;
////    while(cin >> n) {
////        string ans = "";
//////        if(n == 0) cout << 0 << endl;
////        while(n) {
////            int m = n;
////            int x = abs(n) % 2;
////            char c = x + '0';
////            ans += c ;
////            n /= -2;
////            if(m < 0 && abs(m) & 1)
////                n++;
////        }
////        reverse(ans.begin(),ans.end());
////        cout << ans << endl;
////    }
////    return 0;
////}
////
//
//
//
//
//
////
#include <bits/stdc++.h>

using namespace std;

int a[2000020];
int vis[2000020];
const int maxn = 1e5 + 10;
bool cmp(int a,int b) {
    return a > b;
}
int main() {
    int n;
    while(cin >> n) {
        memset(vis,0,sizeof(vis));
        for(int i = 1; i <= n; i++) cin >> a[i];
        int cnt1 = 0,cnt2 = 0;
        int ans1 = 0,ans2 = 0;
        int id1 = 0,id2 = 0;
        int Max1 = 0,Max2 = 0;
        for(int i = 1; i <= n; i += 2) {
            vis[a[i]]++;
            if(Max1 < vis[a[i]]) {
                Max1 = vis[a[i]] ;
                id1 = i;
            }
        }
        sort(vis,vis + maxn,cmp);
        int m1 = n / 2 - vis[0],m2 = n / 2 - vis[1];
        memset(vis,0,sizeof(vis));
        for(int i = 2; i <= n; i += 2) {
            vis[a[i]]++;
            if(Max2 < vis[a[i]]) {
                Max2 = vis[a[i]] ;
                id2 = i;
            }
        }
        sort(vis,vis + maxn,cmp);
        int m3 = n / 2 - vis[0], m4 = n / 2 - vis[1];
//        printf("%d  %d  %d  %d\n",m1,m2,m3,m4);
        if(a[id1] == a[id2]) {
            cout << min(m1 + m4,m2 + m3) << endl;
        } else {
            cout << m1 + m3 <<endl;
        }

    }
    return 0;
}




//#include <bits/stdc++.h>
//using namespace std;
//
//const int p[] = {1,2,3,4,5,6,7,8,9,11,22,33,44,55,66,77,88,99,111,222,333,444,555,666,777,888,999,1111,2222,3333,4444,5555,6666,7777,8888,9999};
//
//int main() {
//	int n;
//	cin >> n;
//	for (int i = 0; ; ++ i) {
//		if (p[i] >= n) {cout << p[i];return 0;}
//	}
//}
//

//
//
//
////#include <bits/stdc++.h>
////
////using namespace std;
////
////const int maxn = 200000;
////map<long long,long long>mm;
////int n;
////long long m;
////int main() {
////    while(cin >> n >> m) {
////        long long num,sum = 0,ans = 0;
////        mm.clear();
////        mm[0]++;
////        for(int i = 1; i <= n; i++) {
////            cin >> num;
////            sum += num;
////            sum %= m;
////            ans += mm[sum];
////            mm[sum]++;
//////            cout << sum <<"   " << ans << endl;
////        }
////        cout << ans << endl;
////    }
////    return 0;
////}






//
//#include <bits/stdc++.h>
//using namespace std;
//
//const int maxn = 1e5 + 10;
//
//int a[maxn];
//int cnt[maxn];
//
//bool cmp(int x,int y) {
//    return x > y;
//}
//
//int main() {
//    int n, ans = 0, res = 0;
//    cin >> n;
//    for (int i = 1; i <= n; ++ i) cin >> a[i];
//    int s1 = 0, s2 = 0, id1 = 0, id2 = 0;
//    for (int i = 1; i <= n; i += 2) {
//        ans ++, cnt[a[i]] ++;
//        if (cnt[a[i]] > s1) s1 = cnt[a[i]], id1 = a[i];
//    }
//    sort(cnt, cnt + maxn, cmp);
//    int max1 = ans - cnt[0], max2 = ans - cnt[1];
//    memset(cnt, 0, sizeof(cnt));
//    for (int i = 2; i <= n; i += 2) {
//        res ++, cnt[a[i]] ++;
//        if (cnt[a[i]] > s2) s2 = cnt[a[i]], id2 = a[i];
//    }
//    sort(cnt, cnt + maxn, cmp);
//    int mmx1 = res - cnt[0], mmx2 = res - cnt[1];
//    if (id1 == id2) {
//        cout << min(mmx1 + max2, mmx2 + max1) << endl;
//        return 0;
//    } else {
//        cout << max1 + mmx1 << endl;
//        return 0;
//    }
//}


Measured memory_bytes: 10624