#include <bits/stdc++.h>
using namespace std;
int a[105], b[105];
int main() {
  int n, l = 0, r = 0, a, b;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a >> b;
    l += a;
    r += b;
  }
  int ans = l + n - r;
  ans = min(ans, r + n - l);
  ans = min(ans, l + r);
  ans = min(ans, n - l + n - r);
  cout << ans;
}
