#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int left0 = 0, left1 = 0, right0 = 0, right1 = 0, door;
  for (int i = 0; i < n; i++) {
    cin >> door;
    if (door == 0)
      left0++;
    else
      left1++;
    cin >> door;
    if (door == 0)
      right0++;
    else
      right1++;
  }
  door = 0;
  if (left0 <= left1)
    door += left0;
  else
    door += left1;
  if (right0 <= right1)
    door += right0;
  else
    door += right1;
  cout << door << endl;
  return 0;
}
