#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int sum = 0;
  int count = 0, flag = 0;
  int t;
  cin >> t;
  int arr[t][2];
  for (long long i = 0; i < t; i++) {
    for (int j = 0; j < 2; j++) {
      cin >> arr[i][j];
    }
  }
  for (int i = 0; i < 2; i++) {
    flag = 0;
    count = 0;
    for (int j = 0; j < t; j++) {
      if (arr[j][i] == 0) {
        flag++;
      } else {
        count++;
      }
    }
    if (flag <= count) {
      sum = sum + flag;
    } else {
      sum = sum + count;
    }
  }
  cout << sum << "\n";
  return 0;
}
