#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[n], b[n];
  for (int i = 0; i < n; i++) cin >> a[i] >> b[i];
  int a0, a1, b0, b1;
  a0 = count(a, a + n, 0);
  a1 = count(a, a + n, 1);
  b0 = count(b, b + n, 0);
  b1 = count(b, b + n, 1);
  cout << ((n - max(a0, a1)) + (n - max(b0, b1)));
}
