#include<bits/stdc++.h>

using namespace std;

#define ll  long long
#define ld  double

#define sz(x)   (int)x.size()
#define all(x)  x.begin(),x.end()

#define pb  emplace_back
#define X   first
#define Y   second

const int   N   = 505;

typedef pair<int,int>   ii;

ll  f[N][N];
ll  s_r[N][N];
ll  s_c[N][N];

int main()  {
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);

    int n;  cin >> n;

    for(int i = 1 ; i <= n ; ++i)
    for(int j = 1 ; j <= n ; ++j)   {
        int x = 0;
        int y = 0;

        if (i < j)  cin >> x;
        if (i > j)  cin >> y;

        s_r[i][j] = x + s_r[i][j - 1] + s_r[i - 1][j] - s_r[i - 1][j - 1];
        s_c[i][j] = y + s_c[i][j - 1] + s_c[i - 1][j] - s_c[i - 1][j - 1];
    }
    for(int i = 0 ; i <= n ; ++i)
    for(int j = 0 ; j <= n ; ++j)
        f[i][j] = 1e18;

    f[0][0] = 0;

    for(int i = 0 ; i <  n ; ++i)
    for(int j = 0 ; j <= i ; ++j)   if (f[i][j] < 1e18)
        for(int k = i + 1 ; k <= n ; ++k)   {
            ll  nxt = f[i][j];

            nxt += s_r[k][k] + s_r[i][i] - s_r[k][i] - s_r[i][k];
            nxt += s_c[n][i] + s_c[k][j] - s_c[k][i] - s_c[n][j];

            if (f[k][i] > nxt)
                f[k][i] = nxt;
        }

    cout << *min_element(f[n],f[n] + 1 + n) << endl;
}