function Main(input) {
  var data = input.split("\n")
  var n = parseInt(data[0])
  var v = data[1].split(' ')
  var c = 0;
  
  var object1 = {}
  for (var i = 0; i < n; i = i + 2) {
    if (!object1[v[i]]) {
      object1[v[i]] = 0
    }
    object1[v[i]]++
  }

  var m0 = null
  var m0max = null
  for (var k in object1) {
    if (m0 === null) {
      m0 = k
      m0max = object1[k]
    }

    if (object1[k] > m0max) {
      m0 = k
      m0max = object1[k]
    }
  }

  var object2 = {}
  for (var i = 1; i < n; i = i + 2) {
    if (!object2[v[i]]) {
      object2[v[i]] = 0
    }
    object2[v[i]]++
  }

  var m1 = null
  var m1max = null
  for (var k in object2) {
    if (m1 === null) {
      m1 = k
      m1max = object2[k]
    }
    
    if (object2[k] > m1max) {
      m1 = k
      m1max = object2[k]
    }
  }

  for (var i = 0; i < n; i = i + 2) {
    if (m0 !== v[i]) {
      c++;
    }
  }

  for (var i = 1; i < n; i = i + 2) {
    if (m1 !== v[i]) {
      c++;
    }
  }

  if (c === 0) {
    if (v[0] === v[1]) {
      c = n / 2
    }
  }

  console.log(c);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));