#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, lz = 0, lo = 0, rz = 0, ro = 0, l, r;
  cin >> n;
  int k = n;
  int s = n;
  while (n--) {
    cin >> l >> r;
    if (l == 0)
      lz++;
    else
      lo++;
    if (r == 0)
      rz++;
    else
      ro++;
  }
  if (lz > lo)
    s -= lz;
  else
    s -= lo;
  if (rz > ro)
    k -= rz;
  else
    k -= ro;
  cout << s + k;
}
