#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  int state[N][2];
  for (int i = 0; i < N; i++) {
    cin >> state[i][0] >> state[i][1];
  }
  int min = 3 * N + 1;
  for (int k = 0; k < 4; k++) {
    int a = k / 2;
    int b = k % 2;
    int num = 0;
    for (int i = 0; i < N; i++) {
      num += (a ^ state[i][0]) + (b ^ state[i][1]);
    }
    if (num < min) min = num;
  }
  cout << min;
}
