#include <bits/stdc++.h>
using namespace std;
int main() {
  int l[10001], r[10001], n, a = 0, b = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> r[i] >> l[i];
  }
  for (int i = 0; i < n; i++) {
    a = a + r[i];
    b = b + l[i];
  }
  if (a == 0 && b == 0) {
    cout << "0";
    return 0;
  }
  if (a == n && b == 0 || b == n && a == 0) {
    cout << "0";
    return 0;
  }
  if (b == n)
    cout << n - a;
  else if (a == n)
    cout << n - b;
  else if (a == b)
    cout << n - a + n - b;
  else {
    if (b > a)
      cout << n - b + a;
    else if (a > b)
      cout << n - a + b;
  }
  return 0;
}
