#include <bits/stdc++.h>   using namespace std;   int main() {     ios_base::sync_with_stdio(0);     long long n, cnt1 = 0, cnt2 = 0, l, r;     cin >> n;     for (int i = 0; i < n; i++) {       cin >> l >> r;       cnt1 += l;       cnt2 += r;     }     cout << min(cnt1, n - cnt1) + min(cnt2, n - cnt2);   }   