#include <bits/stdc++.h>

using namespace std;

class Point
{
    public:
        long x, y;

        Point(long x, long y) {
            this->x = x;
            this->y = y;
        }

        Point() {}
};

long numOfMoves(Point p1, Point p2) {
    return abs(p1.x - p2.x) + abs(p1.y - p2.y);
}

int main() {
    long n;

    scanf("%ld", &n);
    vector<Point> allPoints(n);

    for(long i=0; i<n; i++) {
        long x, y;

        scanf("%ld", &x);
        scanf("%ld", &y);

        allPoints[i]=Point(x,y);
    }

    long long sum1 = 0;
    vector<bool> takenPoints1(n, false);

    for(long i=0; i<n; i++) {
        long long least = numOfMoves(Point(i+1,i+1), allPoints[0]);
        takenPoints1[0]=true;
        for(long j=1; j<n; j++) {
            if(takenPoints1[j] || least == 0)
                continue;

            long long nom = numOfMoves(Point(i+1,i+1), allPoints[j]);
//            printf("[%ld, %ld], Tacka: [%ld, %ld], Rez: %ld\n",i+1,i+1,allPoints[j].x, allPoints[j].y, nom);
            if(nom<least) {
                least = nom;
                takenPoints1[j]=true;
            }
        }

        sum1+=least;
    }

    if(sum1 == 0) {
        cout<<sum1;
        return 0;
    }

    long long sum2 = 0;
    vector<bool> takenPoints2(n, false);

    for(long i=0; i<n; i++) {
        long long least = numOfMoves(Point(n-i+1,i), allPoints[0]);
        takenPoints2[0]=true;

        for(long j=1; j<n; j++) {
            if(takenPoints2[j] || least == 0)
                continue;

            long long nom = numOfMoves(Point(n-i+1,i), allPoints[j]);
//            printf("[%ld, %ld], Tacka: [%ld, %ld], Rez: %ld\n",n-i+1,n-i+1,allPoints[j].x, allPoints[j].y, nom);
            if(nom<least) {
                least = nom;
            }
        }

        sum2+=least;
    }

    cout<<min(sum1,sum2);

    return 0;
}