#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  int time = 0;
  int l[n];
  int r[n];
  int cl0 = 0;
  int cl1 = 0;
  int cr0 = 0;
  int cr1 = 0;
  for (int i = 0; i < n; i++) {
    cin >> l[i] >> r[i];
    if (l[i] == 0)
      cl0++;
    else
      cl1++;
    if (r[i] == 0)
      cr0++;
    else
      cr1++;
  }
  if (cl0 > cl1)
    time += cl1;
  else
    time += cl0;
  if (cr0 > cr1)
    time += cr1;
  else
    time += cr0;
  cout << time;
  return 0;
}
