#include<iostream>
using namespace std;
const int N = 1e5 + 10;
pair<int,int>a[N];
#define x first
#define y second
int main()
{
int n;
cin >> n;
for(int i = 1; i <= n; i ++)
{
cin >> a[i].x >> a[i].y;
}
int mx = 0;
int ans = 0;
int j;
for(int i = 2; i <= n ; i ++)
{
int d = abs(a[i].x - a[i - 1].x) + abs(a[i].y - a[i - 1].y) +abs(a[i + 1].x - a[i].x) + abs(a[i + 1].y - a[i].y)- abs(a[i + 1].x - a[i - 1].x) - abs(a[i + 1].y - a[i - 1].y);
if(d >= mx){
mx = d;
j = i;
}
}
a[j].x = a[j - 1].x, a[j ].y = a[j - 1].y;
for(int i = 2; i <= n; i ++)
{
ans += abs(a[i].x - a[i - 1].x) + abs(a[i].y - a[i - 1].y);
}
cout <<ans<<endl;
}