#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n, ia = 0, ic = 0, ra = 0, rc = 0, moves = 0;
  pair<int, int> aux;
  cin >> n;
  vector<pair<int, int>> doors(n);
  for (int i = 0; i < n; ++i) {
    cin >> doors[i].first;
    cin >> doors[i].second;
    if (doors[i].first == 0)
      ++ic;
    else
      ++ia;
    if (doors[i].second == 0)
      ++rc;
    else
      ++ra;
  }
  for (int i = 0; i < doors.size(); ++i) {
    if (ia > ic) {
      if (doors[i].first == 0) ++moves;
    } else if (doors[i].first == 1)
      ++moves;
    if (ra > rc) {
      if (doors[i].second == 0) ++moves;
    } else if (doors[i].second == 1)
      ++moves;
  }
  cout << moves;
  return 0;
}
