#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>
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 ans = 0;
for(int i = 0; i < sz(a); i++){
//cout << a[i] << " ";
ans += abs(a[i] - ma);
}
forr(i, 0, sz(b)){
// cout << b[i] << " ";
ans += abs(b[i] - mb);
}
assert(ans % 2 == 0);
cout << ans / 2;
}
I2luY2x1ZGU8Yml0cy9zdGRjKysuaD4KI2luY2x1ZGU8ZnN0cmVhbT4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKaWZzdHJlYW0gZmluKCJWTk9JQ1VQLklOUCIpOwpvZnN0cmVhbSBmb3V0KCJWTk9JQ1VQLk9VVCIpOwojZGVmaW5lIHN6KGEpIChpbnQpYS5zaXplKCkKI2RlZmluZSBsbCBsb25nIGxvbmcKI2RlZmluZSBwYiBwdXNoX2JhY2sKI2RlZmluZSBmb3JyKGksIGEsIGIpIGZvcihpbnQgaSA9IGE7IGkgPCBiOyBpKyspCiNkZWZpbmUgZG9ycihpL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