#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  int ll = 0, rr = 0;
  for (int i = 0; i < n; i++) {
    int l, r;
    scanf("%d%d", &l, &r);
    if (l) ll++;
    if (r) rr++;
  }
  if (ll * 2 > n) ll = n - ll;
  if (rr * 2 > n) rr = n - rr;
  printf("%d\n", ll + rr);
  return 0;
}
