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;
    }

    return changeCount(countOddMap) + count(changeCountAddMap);
}

function changeCount(map){
    var max = maxNum(map);
    var count = 0;
    for(var num in map){
        if(num != max){
            count += map[num];
        }
    }
    if(count > map[max]) return map[max];
    return count;
}

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")));