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