#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> v(n), b(n);
  for (int i = 0; i < n; i++) cin >> v[i] >> b[i];
  int ans = 1000000000;
  for (int i = 0; i < 4; i++) {
    int cnt = 0;
    for (int j = 0; j < n; j++) {
      if ((bool)v[j] != (bool)(i & 1)) ++cnt;
      if ((bool)b[j] != (bool)((i >> 1) & 1)) ++cnt;
    }
    ans = min(ans, cnt);
  }
  cout << ans << endl;
  return 0;
}
