#include <bits/stdc++.h>
using namespace std;
static const double EPS = 1e-5;
int main() {
  ifstream ifs("input.txt");
  ofstream ofs("output.txt");
  int N;
  cin >> N;
  int l = 0, r = 0;
  for (int i = 0; i < N; ++i) {
    int tmp;
    cin >> tmp;
    if (tmp) ++l;
    cin >> tmp;
    if (tmp) ++r;
  }
  int result = min(l, N - l) + min(r, N - r);
  cout << result;
}
