'use strict';

var hasN = true; // has N only line
var type = "b";
// a: 2D split
// b: space split
// c: line split
// z: other (only source)
function main(N, p, s) {
	var i = 1;
	var odds = p.filter(function (e) {
		return i++ % 2 !== 0;
	});
	var evens = p.filter(function (e) {
		return i++ % 2 === 0;
	});
	var od = odds.every(function (e) {
		return e == odds[0];
	});
	var ev = evens.every(function (e) {
		return e == evens[0];
	});
	if (od && ev && odds[0] !== evens[0]) {
		console.log(0);return;
	}
	if (od && ev && odds[0] === evens[0]) {
		console.log(evens.length);return;
	}
	if (!od) {
		var c = {};
		odds.forEach(function (e) {
			c[e] = c[e] ? c[e] + 1 : 1;
		});
		var odd = odds.length - Math.max.apply(null, Object.keys(c).map(function (e) {
			return c[e];
		}));
	}
	if (!ev) {
		var c = {};
		evens.forEach(function (e) {
			c[e] = c[e] ? c[e] + 1 : 1;
		});
		var evn = evens.length - Math.max.apply(null, Object.keys(c).map(function (e) {
			return c[e];
		}));
	}
	if (typeof odd === 'undefined') {
		console.log(evn);return;
	}
	if (typeof evn === 'undefined') {
		console.log(odd);return;
	}
	console.log(odd + evn);
}
function common(a) {
	var line = a.split('\n').slice(0, a.split('\n').length - 1);
	if (hasN) var N = Number(line.shift());
	switch (type) {
		case "a":
			main(N, line.map(function (e) {
				return e.split(' ').map(function (ee) {
					return Number(ee);
				});
			}), a);
			break;
		case "b":
			main(N, line[0].split(' ').map(function (e) {
				return Number(e);
			}), a);
			break;
		case "c":
			main(N, line, a);
			break;
		case "z":
			main(N, null, a);
	}
}
common(require("fs").readFileSync("/dev/stdin", "utf8"));
