#include using namespace std; #include using namespace atcoder; using ll = long long; using vi = vector; using vvi = vector>; using pii = pair; #define rep(i, n) for (int i = 0; i < (int)(n); ++i) #define repr(i, n) for (int i = (int)(n - 1); i >= 0; --i) int main() { cin.tie(nullptr); ios::sync_with_stdio(false); int n; cin >> n; vi x(n), y(n); rep(i, n) cin >> x[i] >> y[i]; sort(x.begin(), x.end()); sort(y.begin(), y.end()); int a = x[n / 2], b = y[n / 2]; int ret = 0; rep(i, n) ret += abs(x[i] - a) + abs(y[i] - b); cout << ret << endl; return 0; }