#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  int a[n], b[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i] >> b[i];
  }
  int suml = 0, sumr = 0;
  for (int i = 0; i < n; i++) {
    suml += a[i];
    sumr += b[i];
  }
  int ans = 0;
  if (suml > n / 2)
    ans += n - suml;
  else
    ans += suml;
  if (sumr > n / 2)
    ans += n - sumr;
  else
    ans += sumr;
  cout << ans;
  return 0;
}
