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