#include<cstdio>
#include<cctype>
#include<queue>
#include<cmath>
#include<cstring>
#include<algorithm>
#define rep(i,s,t) for(int i=s;i<=t;i++)
#define dwn(i,s,t) for(int i=s;i>=t;i--)
#define ren for(int i=first[x];i;i=next[i])
using namespace std;
const int BufferSize=1<<16;
char buffer[BufferSize],*head,*tail;
inline char Getchar() {
if(head==tail) {
int l=fread(buffer,1,BufferSize,stdin);
tail=(head=buffer)+l;
}
return *head++;
}
inline int read() {
int x=0,f=1;char c=getchar();
for(;!isdigit(c);c=getchar()) if(c==‘-‘) f=-1;
for(;isdigit(c);c=getchar()) x=x*10+c-‘0‘;
return x*f;
}
typedef long long ll;
const int maxn=100010;
int n,x[maxn],y[maxn];
ll solve(int X,int Y) {
ll ans=0;
rep(i,1,n) ans+=abs(X-x[i])+abs(Y-y[i]);
return ans;
}
int main() {
n=read();
rep(i,1,n) {
int a=read(),b=read();
x[i]=a+b;y[i]=a-b;
}
sort(x+1,x+n+1);sort(y+1,y+n+1);
int X=x[n+1>>1],Y=y[n+1>>1];
if(~(X^Y)&1) printf("%lld\n",solve(X,Y)/2);
else printf("%lld\n",min(min(solve(X-1,Y),solve(X,Y-1)),min(solve(X+1,Y),solve(X,Y+1)))/2);
return 0;
}