#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  int zuo = 0, you = 0;
  for (int i = 0; i < n; i++) {
    int x, y;
    scanf("%d %d", &x, &y);
    zuo += x;
    you += y;
  }
  printf("%d\n", min(n - zuo, zuo) + min(n - you, you));
  return 0;
}
