#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int arr[n][2];
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < 2; j++) {
      cin >> arr[i][j];
    }
  }
  int x1 = 0, y1 = 0, x2 = 0, y2 = 0;
  for (int i = 0; i < n; i++) {
    if (arr[i][0] == 0) {
      x1++;
    } else {
      y1++;
    }
  }
  for (int i = 0; i < n; i++) {
    if (arr[i][1] == 0) {
      x2++;
    } else {
      y2++;
    }
  }
  int t = min(x1, y1);
  int o = min(x2, y2);
  cout << t + o << endl;
  return 0;
}
