#include <bits/stdc++.h>
using namespace std;
void seif() { std::ios_base::sync_with_stdio(0); }
int main() {
  seif();
  int n, lf = 0, rz = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int x, y;
    cin >> x >> y;
    if (x == 0) lf++;
    if (y == 0) rz++;
  }
  if (lf <= n / 2) lf = n - lf;
  if (rz <= n / 2) rz = n - rz;
  cout << (n - lf) + (n - rz);
  return 0;
}
