#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
long long power(long long a, long long b, long long p) {
  long long res = 1;
  a %= p;
  while (b) {
    if (b & 1) res = (res * a) % p;
    a = (a * a) % p;
    b >>= 1;
  }
  return res;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  int arr1[n], arr2[n];
  for (int i = 0; i < n; i++) {
    int x, y;
    cin >> x >> y;
    arr1[i] = x;
    arr2[i] = y;
  }
  int countzero1 = 0;
  for (int i = 0; i < n; i++) {
    if (arr1[i] == 0) countzero1++;
  }
  int countzero2 = 0;
  for (int i = 0; i < n; i++) {
    if (arr2[i] == 0) countzero2++;
  }
  cout << min(countzero1, n - countzero1) + min(countzero2, n - countzero2)
       << endl;
  return 0;
}
