// Arup Guha
// 2/26/2018
// Solution to 2018 Mercer Programming Contest Problem 5: Dog Park

import java.util.*;

public class dogpark {

	public static void main(String[] args) {

		Scanner stdin = new Scanner(System.in);
		int n = stdin.nextInt();

		// Process each case.
		while (n != 0) {

			// Just store x and y separate.
			int[] x = new int[n];
			int[] y = new int[n];
			for (int i=0; i<n; i++) {
				x[i] = stdin.nextInt();
				y[i] = stdin.nextInt();
			}

			// Sort both.
			Arrays.sort(x);
			Arrays.sort(y);

			// The classic solution is just to put the dog park at the median of
			// both sets of coordinates. I am assuming that the park can be placed
			// where there is a house...
			int res = 0;
			for (int i=0; i<n; i++) {
				res += Math.abs(x[i]-x[n/2]);
				res += Math.abs(y[i]-y[n/2]);
			}

			// Ta da!
			System.out.println(res);

			// Get next case.
			n = stdin.nextInt();
		}
	}
}