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