#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  int v1;
  int nb1, nb11;
  vector<vector<int> > v;
  cin >> n;
  int nb;
  for (int i = 0; i < n; i++) {
    vector<int> row;
    for (int j = 0; j < 2; j++) {
      cin >> v1;
      row.push_back(v1);
    }
    v.push_back(row);
  }
  nb1 = 0;
  nb11 = 0;
  for (int i = 0; i < n; i++) {
    if (v[i][0] == 1) nb1++;
    if (v[i][1] == 1) nb11++;
  }
  int m;
  if (n % 2 != 0)
    m = (n / 2) + 1;
  else
    m = n / 2;
  if (nb1 >= m)
    nb = n - nb1;
  else
    nb = nb1;
  if (nb11 >= m)
    nb = nb + n - nb11;
  else
    nb = nb + nb11;
  cout << nb << endl;
  return 0;
}
