#include<bits/stdc++.h>
#include<fstream>
using namespace std;
ifstream fin("VNOICUP.INP");
ofstream fout("VNOICUP.OUT");
#define sz(a) (int)a.size()
#define ll long long
#define pb push_back
#define forr(i, a, b) for(int i = a; i < b; i++)
#define dorr(i, a, b) for(int i = a; i >= b; i--)
#define ld long double
#define vt vector
#include<fstream>
#define fi first
#define se second
#define pll pair<ll, ll>
#define pii pair<int, int>
#define mp make_pair
const ld PI = 3.14159265359;
using u128 = __uint128_t;
//const int x[4] = {1, -1, 0, 0};
//const int y[4] = {0, 0, 1, -1};
const ll mod = 1e9 + 7;
const int mxn = 1e5 + 5, mxq = 2e5 + 5, sq = 400, mxv = 15 * 10, pr = 31;
const int base = (1 << 18);
const ll inf = 2e9, neg = -69420, add = 1e9;
int n;
signed main(){
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    cin >> n;
    vt<ll>a(n), b(n);
    for(int i = 0; i < n; i++){
        ll x, y; cin >> x >> y; 
        a[i] = (x + y); b[i] = (x - y);
    }
    sort(a.begin(), a.end()); sort(b.begin(), b.end());
    ll ma = a[sz(a) / 2], mb = b[sz(b) / 2];
    ll res = 1e18;
    for(auto [pa, pb]: {mp(ma, mb), mp(ma - 1, mb), mp(ma + 1, mb), mp(ma, mb - 1), mp(ma, mb + 1)}){
        if((pa + pb) & 1)continue;
        ll ans = 0;
        for(int i = 0; i < sz(a); i++){
        //cout << a[i] << " ";
             ans += abs(a[i] - pa);
        }
        forr(i, 0, sz(b)){
       // cout << b[i] << " ";
            ans += abs(b[i] - pb);
        }
        res = min(res, ans);
    }
    
    assert(res % 2 == 0);
    cout << res / 2;
}