#include <bits/stdc++.h>
using namespace std;
int read();

int n;
long long f[1003][1003], s[2][1003][1003];
long long qry0(int i, int j) { return s[0][n][i] - s[0][j][i]; }
long long qry1(int i, int j, int k) {
    return s[1][n][j] - s[1][n][k] - s[1][i][j] + s[1][i][k];
}
int main() {
    n = read();
    for (int i = 1; i <= n; ++i)
        for (int j = 1; j <= n; ++j)
            if (i < j)
                s[0][i][j] = read();
            else if (i > j)
                s[1][i][j] = read();

    n += 2;
    for (int i = 1; i <= n; ++i)
        for (int j = 1; j <= n; ++j) {
            s[0][i][j] += s[0][i][j - 1] + s[0][i - 1][j] - s[0][i - 1][j - 1];
            s[1][i][j] += s[1][i][j - 1] + s[1][i - 1][j] - s[1][i - 1][j - 1];
        }

    for (int i = 0; i <= n; ++i) f[i][0] = qry0(i, 0);
    for (int i = 1; i <= n; ++i)
        for (int j = 1; j < i; ++j) {
            f[i][j] = 10000000000000000ll;
            for (int k = 0; k < j; ++k)
                f[i][j] = min(f[i][j], f[j][k] + qry1(i, j, k));
            f[i][j] += qry0(i, j);
        }

    printf("%lld\n", f[n][n - 1]);
    return 0;
}
const int _SIZE = 1 << 22;
char ibuf[_SIZE], *iS = ibuf, *iT = ibuf;
#define gc                                                         \
    (iS == iT ? iT = ((iS = ibuf) + fread(ibuf, 1, _SIZE, stdin)), \
     (iS == iT ? EOF : *iS++) : *iS++)
int read() {
    int x = 0, f = 1;
    char c = gc;
    while (!isdigit(c)) f = (c == '-') ? -1 : f, c = gc;
    while (isdigit(c)) x = x * 10 + c - '0', c = gc;
    return x * f;
}