#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int left, right;
  int l, r;
  l = r = 0;
  for (int i = 0; i < n; i++) {
    cin >> left >> right;
    l += left;
    r += right;
  }
  cout << min(l, n - l) + min(r, n - r);
}
