#include <bits/stdc++.h>
using namespace std;
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  int lzero = 0, lone = 0, rzero = 0, rone = 0;
  int a, b;
  int temp = n;
  while (temp--) {
    cin >> a >> b;
    if (a == 0) {
      lzero++;
    } else {
      lone++;
    }
    if (b == 0) {
      rzero++;
    } else {
      rone++;
    }
  }
  int answ = 0;
  if (lzero > lone) {
    answ = answ + n - lzero;
  } else {
    answ = answ + n - lone;
  }
  if (rzero > rone) {
    answ = answ + n - rzero;
  } else {
    answ = answ + n - rone;
  }
  cout << answ;
}
