#include using namespace std; using ll = long long; #define rep(i,m,n) for(int i=m; i> N; vector X(N), Y(N); rep(i, 0, N) cin >> X[i] >> Y[i]; int ans = 1 << 30; rep(x, 1, 301){ rep(y, 1, 301){ int s = 0; rep(i, 0, N){ s += dist(x, y, X[i], Y[i]); } ans = min(ans, s); } } cout << ans << endl; return 0; }