#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n, x, y, count1 = 0, count2 = 0, ans;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> x >> y;
    count1 += x;
    count2 += y;
  }
  ans = min(count1, n - count1) + min(count2, n - count2);
  cout << ans;
}
