#include <bits/stdc++.h>

using namespace std;

typedef unsigned int ui;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<long long, long long> pll;
typedef long double ld;

const int inf = 1e9;
const ll inf64 = 1e18;

inline void upd(ll &x, ll y) {
    if (x > y) {
        x = y;
    }
}

const int N = 505;

inline ll get_sum(int li, int lj, int ri, int rj, ll arr[N][N]) {
    if (li > ri || lj > rj) return 0;
    ll res = 0;
    res += arr[ri][rj];
    if (li > 0) res -= arr[li - 1][rj];
    if (lj > 0) res -= arr[ri][lj - 1];
    if (li > 0 && lj > 0) res += arr[li - 1][lj - 1];
    return res;
}

int n;
int a[N][N];
ll col[N][N];
ll str[N][N];
ll dp[2][N][N];
ll R[N][N];
ll L[N][N];

ll slow() {
    int tot = 1 << (n - 1);
    ll result = inf64;
    for (int mask = 0; mask < tot; mask++) {
        vector<ll> pref(n);
        for (int i = 0; i + 1 < n; i++) {
            pref[i + 1] = pref[i];
            if ((1 << i) & mask) {
                pref[i + 1]++;
            }
        }
        ll tmp = 0;
        for (int fr = 0; fr < n; fr++) {
            for (int to = 0; to < n; to++) {
                if (fr == to) {
                    continue;
                }
                if (fr < to && pref[to] - pref[fr] < 1) {
                    tmp += a[fr][to];
                }
                if (fr > to && pref[fr] - pref[to] > 1) {
                    tmp += a[fr][to];
                }
            }
        }
        for (int i = 0; i + 1 < n; i++) {
            cout << ((mask >> i) & 1);
        }
        cout << " : " << tmp << "\n";
        upd(result, tmp);
    }
    return result;
}

ll fast() {
    ll result = inf64;

    {
        ll tmp = 0;
        for (int i = 0; i < n; i++) {
            for (int j = i + 1; j < n; j++) {
                tmp += a[i][j];
            }
        }
        upd(result, tmp);
    }

    {
        for (int i = 0; i + 1 < n; i++) {
            ll tmp = 0;
            for (int j = 0; j <= i; j++) {
                for (int k = j + 1; k <= i; k++) {
                    tmp += a[j][k];
                }
            }
            for (int j = i + 1; j < n; j++) {
                for (int k = j + 1; k < n; k++) {
                    tmp += a[j][k];
                }
            }
            upd(result, tmp);
        }
    }

    fill((ll*) dp, (ll*) dp + 2 * N * N, inf64);

    dp[1][0][1] = a[2][0];

    for (int i = 2; i + 1 < n; i++) {
        fill((ll*) dp[i & 1], (ll*) dp[i & 1] + N * N, inf64);
        for (int j = i - 1; j >= 0; j--) {
            for (int k = j - 1; k >= 0; k--) {
                upd(
                        dp[i & 1][j][i],
                        dp[(i - 1) & 1][k][j] + str[i + 1][j]
                );
                upd(
                        dp[i & 1][k][j],
                        dp[(i - 1) & 1][k][j]
                        + (col[i][i + 1] - col[j][i + 1])
                        + str[i + 1][k]
                );
            }
        }
        for (int j = i; j >= 0; j--) {
            for (int k = j - 1; k >= 0; k--) {
//                ll tmp = 0;
//                for (int fr = 0; fr <= k; fr++) {
//                    for (int to = fr; to <= k; to++) {
//                        tmp += a[fr][to];
//                    }
//                }
//                for (int fr = k + 1; fr <= j; fr++) {
//                    for (int to = fr; to <= j; to++) {
//                        tmp += a[fr][to];
//                    }
//                }
//                for (int fr = j + 1; fr <= i + 1; fr++) {
//                    for (int to = fr; to <= i + 1; to++) {
//                        tmp += a[fr][to];
//                    }
//                }
//                for (int fr = j + 1; fr <= i + 1; fr++) {
//                    for (int to = k; to >= 0; to--) {
//                        tmp += a[fr][to];
//                    }
//                }
//                upd(dp[i][j][k], tmp);
                upd(
                    dp[i & 1][k][j],
                    get_sum(0, 0, k, k, R)
                    + get_sum(k + 1, k + 1, j, j, R)
                    + get_sum(j + 1, j + 1, i + 1, i + 1, R)
                    + get_sum(j + 1, 0, i + 1, k, L)
                );
            }
        }
    }

    for (int k = 0; k + 1 < n; k++) {
        for (int j = k + 1; j + 1 < n; j++) {
            upd(result, dp[(n - 2) & 1][k][j]);
        }
    }

    return result;
}

void test() {
    ll fs = fast();
    ll sl = slow();
    if (fs != sl) {
        cout << "WA!\n";
        cout << n << "\n";
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < n; j++) {
                if (i == j) continue;
                cout << a[i][j] << " ";
            }
            cout << "\n";
        }
        cout << "expected: " << sl << "\n";
        cout << "found: " << fs << "\n";
    } else {
        cout << "OK (" << fs << " == " << sl << ")\n";
    }
}

int main() {

#ifdef debug
    freopen("input.txt", "r", stdin);
#endif

    mt19937_64 rnd(time(NULL));

    cin >> n;

    for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++) {
            if (i == j) {
                continue;
            }
            cin >> a[i][j];
            if (i < j) {
                R[i][j] = a[i][j];
            } else {
                L[i][j] = a[i][j];
            }
        }
    }

    for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++) {
            if (j > 0) {
                str[i][j] = str[i][j - 1];
            }
            str[i][j] += a[i][j];

            if (i > 0) {
                col[i][j] = col[i - 1][j];
            }
            col[i][j] += a[i][j];

            if (i > 0) {
                L[i][j] += L[i - 1][j];
                R[i][j] += R[i - 1][j];
            }
            if (j > 0) {
                L[i][j] += L[i][j - 1];
                R[i][j] += R[i][j - 1];
            }
            if (i > 0 && j > 0) {
                L[i][j] -= L[i - 1][j - 1];
                R[i][j] -= R[i - 1][j - 1];
            }
        }
    }

//    test();
//    slow();
    cout << fast() << "\n";

    return 0;
}

Measured memory_bytes: 13184