#include <bits/stdc++.h>
using namespace std;
int n, input, left_ones, right_ones;
int resp;
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> input;
    if (input) left_ones++;
    cin >> input;
    if (input) right_ones++;
  }
  if (left_ones <= (n / 2))
    resp += left_ones;
  else
    resp += n - left_ones;
  if (right_ones <= (n / 2))
    resp += right_ones;
  else
    resp += n - right_ones;
  cout << resp;
  return 0;
}
