#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n;
  cin >> n;
  long long int l[n], r[n], l0 = 0, l1 = 0, r0 = 0, r1 = 0, c = 0;
  for (int i = 0; i < n; i++) {
    cin >> l[i] >> r[i];
    if (l[i] == 0)
      l0++;
    else
      l1++;
    if (r[i] == 0)
      r0++;
    else
      r1++;
  }
  if (l0 >= l1 && l0 != n)
    c = l1;
  else if (l0 < l1 && l1 != n)
    c = l0;
  if (r0 >= r1 && r0 != n)
    c += r1;
  else if (r0 < r1 && r1 != n)
    c += r0;
  cout << c;
  return 0;
}
