#include using namespace std; typedef long long ll; typedef long double ld; typedef pair ii; typedef vector vi; typedef vector vvi; typedef vector vii; #define x first #define y second #define pb push_back #define eb emplace_back #define all(v) (v).begin(), (v).end() void run() { ll n; cin >> n; vi A(n, 0); for (ll i = 0; i < n; i++) { for (ll j = 0; j < n; j++) { ll c; cin >> c; A[i] += c; } } sort(all(A)); ll res = 0; for (ll i = 0; i < n; i++) { if (2*i < n) res -= A[i]; else res += A[i]; } cout << res/2 << endl; } signed main() { ios_base::sync_with_stdio(false); cin.tie(0); run(); return 0; }