#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  cin >> n;
  int leftzero = 0, rightzero = 0;
  for (int i = 1; i <= n; i++) {
    int x, y;
    cin >> x >> y;
    if (x == 0) {
      leftzero++;
    }
    if (y == 0) {
      rightzero++;
    }
  }
  cout << min(leftzero, n - leftzero) + min(rightzero, n - rightzero) << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  solve();
}
