#include using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep1(i, n) for (int i = 1; i < (int)(n + 1); i++) using ll = long long; using P = pair; using Graph = vector>; int main() { int N; cin >> N; vector x(N); vector y(N); rep(i, N) { cin >> x[i]; cin >> y[i]; } sort(x.begin(), x.end()); sort(y.begin(), y.end()); int mx = 0, my = 0; for (int i = N - 1; i >= 0; i--) { mx += x[i]; my += y[i]; } mx /= N; my /= N; int ans = 0; rep(i, N){ ans += abs(mx-x[i]); ans += abs(my-y[i]); } cout << ans << endl; }