#include <bits/stdc++.h>
using namespace std;
template <typename T>
vector<vector<T> > arr2d(long long r, long long c, T val) {
  vector<vector<T> > v;
  for (long long i = 0; i < r; i++) {
    vector<T> x(c, val);
    v.emplace_back(x);
  }
  return v;
}
template <typename T>
void p2d(vector<vector<T> > a, long long r, long long c) {
  for (long long i = 0; i < r; i += 1) {
    for (long long j = 0; j < c; j += 1) {
      cout << a[i][j] << " ";
    }
    cout << "\n";
  }
}
template <typename T>
void pd(vector<T> a) {
  for (long long i = 0; i < (int)a.size(); i += 1) {
    cout << a[i] << " ";
  }
  cout << "\n";
}
long long a[1000005];
void read(long long n) {
  for (long long i = 0; i < n; i += 1) cin >> a[i];
}
void solve() {
  long long n, x, y, res = 0, left = 0, right = 0;
  cin >> n;
  for (long long i = 0; i < n; i += 1) {
    cin >> x >> y;
    x ? left++ : 0;
    y ? right++ : 0;
  }
  cout << min(left, n - left) + min(right, n - right);
  cout << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  solve();
  return 0;
}
