function main(input){
    var n = input.split("\n")[0];
    var v = input.split("\n")[1];
    var vArray = v.split(" ");

    var countAddMap = {};
    var countOddMap = {};
    var isAllSame = true;
    for (var i = 0; i < n / 2; i++){
	countOddMap[vArray[i*2]] = (countOddMap[vArray[i*2]] || 0) + 1;
	countAddMap[vArray[i*2+1]] = (countAddMap[vArray[i*2+1]] || 0) + 1;

        if(isAllSame && vArray[i*2] != vArray[i*2+1] ){
		isAllSame = false;
        }
    }
    if(isAllSame){
	return n/2;
    }
    if(Object.keys(countOddMap).length === 1 && Object.keys(countAddMap).length === 1){
        return 0;
    }

    var odd = changeCount(countOddMap, n / 2);
    var add = changeCount(countAddMap, n / 2)

    if(odd.minNum !== add.minNum){
	return odd.min + add.min;
    }

    var maxCount = n / 2;
    var oddMinNum = odd.minNum;
    var addMinNum = add.minNum;
    var oddNext = changeCount(countOddMap, maxCount, oddMinNum);
    var addNext = changeCount(countAddMap, maxCount, addMinNum);

    while(oddNext.minNum === add.minNum && odd.minNum === addNext.minNum){
        maxCount -= oddNext.min;
        delete countOddMap[oddMinNum];
        delete countAddMap[addMinNum];
        oddMinNum = oddNext.minNum;
        addMinNum = addNext.minNum;
        oddNext = changeCount(countOddMap, maxCount, oddMinNum);
        addNext = changeCount(countAddMap, maxCount, addMinNum);
    }

    if(oddNext.min + add.min > odd.min + addNext.min){
        return odd.min + addNext.min;
    }
    return oddNext.min + add.min;
}

function changeCount(map, maxCount, filterNum){
    var max = maxNum(map);

    var min = maxCount;
    var minNum = Math.random();
    for(var num in map){
	var count = maxCount - map[num];
        if(count < min && num !== filterNum){
            min = count;
            minNum = num;
        }
    }
    return {min: min, minNum:minNum};
}

function maxNum(map){
    var max = 0;
    var maxNum = -1;
    Object.keys(map).forEach(function (num){
       if(map[num] > max){
           max = map[num];
           maxNum = num;
       }
    });
    return maxNum;
}

console.log(main(require("fs").readFileSync("/dev/stdin", "utf8")));
