#include using namespace std; int main() { int n; cin >> n; vector x(n), y(n); for (int i = 0; i < n; i++) cin >> x[i] >> y[i]; sort(x.begin(), x.end()); sort(y.begin(), y.end()); int ans = 0; for (int i = 0; i < n; i++) ans += abs(x[i] - x[n / 2]) + abs(y[i] - y[n / 2]); cout << ans << endl; }