#include <bits/stdc++.h>
using namespace std;
vector<bool> l, r;
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    bool s, t;
    cin >> s >> t;
    l.push_back(s);
    r.push_back(t);
  }
  int lc = 0;
  int rc = 0;
  for (int i = 0; i < n; i++) {
    if (l[i] == 1) {
      lc++;
    }
    if (r[i] == 1) {
      rc++;
    }
  }
  int ans = min(lc, n - lc) + min(rc, n - rc);
  cout << ans << endl;
  return 0;
}
