// Arup Guha
// 3/30/2024
// Solution to Kattis Problem: Cheating Students 
// https://open.kattis.com/problems/cheatingstudents

import java.util.*;

public class cheatingstudents {

	public static int n;
	public static ArrayList<edge>[] graph;
	public static int[] x;
	public static int[] y;
	
	public static void main(String[] args) {
	
		Scanner stdin = new Scanner(System.in);
		
		n = stdin.nextInt();
		x = new int[n];
		y = new int[n];
		for (int i=0; i<n; i++) {
			x[i] = stdin.nextInt();
			y[i] = stdin.nextInt();
		}
			
		// Form the graph.
		graph = new ArrayList[n];
		for (int i=0; i<n; i++) {
			graph[i] = new ArrayList<edge>();
			
			// Add all edges.
			for (int j=0; j<n; j++) {
				if (i == j) continue;
					
				// This is our new edge.
				graph[i].add(new edge(i, j, dist(i, j)));
			}
		}
			
		// Ta da!
		System.out.println(2*prims(0));
	}
	
	// Runs Prim's from vertex startv and returns the weight of the minimum spanning tree of graph.
	public static int prims(int startv) {
		
		boolean[] used = new boolean[n];
		used[startv] = true;
		int numedges = 0;
		int res = 0;
		PriorityQueue<edge> pq = new PriorityQueue<edge>();
		
		// Add each edge from the start vertex into the priority queue.
		for (edge e: graph[startv])
			pq.offer(e);
		
		// Loop until we have enough edges.
		while (numedges < n-1) {
			
			// Graph isn't connected.
			if (pq.size() == 0) break;
			
			// Get the next edge.
			edge cur = pq.poll();
			
			// Doesn't get us somewhere new, try again.
			if (used[cur.u] && used[cur.v]) continue;
			
			// Figure out new edge.
			int newv = used[cur.v] ? cur.u : cur.v;
			
			// Mark as true.
			used[newv] = true;
			
			// Add edges leaving newv to the priority queue.
			for (edge e: graph[newv])
				pq.offer(e);
			
			// Update edge count and mst result.
			numedges++;
			res += cur.w;
		}
		
		// Means no mst.
		if (numedges < n-1) return -1;
		
		// This is the mst weight.
		return res;
	}
	
	// Returns the Manhattan distance btw. pts i and j.
	public static int dist(int i, int j) {
		return Math.abs(x[i]-x[j]) + Math.abs(y[i]-y[j]);
	}
}

class edge implements Comparable<edge> {

	public int u;
	public int v;
	public int w;
	
	public edge(int myu, int myv, int myw) {
		u = myu;
		v = myv;
		w = myw;
	}
	
	public int compareTo(edge other) {
		return this.w - other.w;
	}

}