#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 50;
const int maxm = 200000 + 50;
const long long inf = 1e18;
const long long mod = 1000000000 + 7;
int sumx, sumy, ans;
int main() {
  int n;
  scanf("%d", &n);
  ans = sumx = sumy = 0;
  for (int i = 1; i <= n; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    if (x == 1) sumx++;
    if (y == 1) sumy++;
  }
  if (sumx > n / 2)
    ans += n - sumx;
  else
    ans += sumx;
  if (sumy > n / 2)
    ans += n - sumy;
  else
    ans += sumy;
  printf("%d", ans);
}
