#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ii = pair<int, int>;
int main() {
  ios::sync_with_stdio(0);
  ll n;
  ll cnt0l = 0, cnt0r = 0;
  cin >> n;
  for (ll i = 0; i < n; i++) {
    ll l, r;
    cin >> l >> r;
    if (l == 0) cnt0l += 1;
    if (r == 0) cnt0r += 1;
  }
  ll res = 0;
  if (cnt0l >= ceil((double)n / 2))
    res += n - cnt0l;
  else
    res += cnt0l;
  if (cnt0r >= ceil((double)n / 2))
    res += n - cnt0r;
  else
    res += cnt0r;
  cout << res << endl;
  return 0;
}
