#include <bits/stdc++.h>
using namespace std;
int n, d[101], a[101], k1, k2;
int main() {
  scanf("%d", &n);
  for (long i = 0; i < n; i++) {
    int x, y;
    scanf("%d %d", &x, &y);
    k1 += x;
    k2 += y;
  }
  printf("%d", min(k1, n - k1) + min(k2, n - k2));
  return 0;
}
