#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,b) for (int i = (a); i <= (b); ++ i)
#define rrp(i,a,b) for (int i = (a); i >= (b); -- i)
#define gc() getchar()
#define fir first
#define sec second
typedef pair<int,int> pii;
typedef double db;
typedef long long ll;
template <typename tp>
inline void read(tp& x) {
  x = 0; char tmp; bool key = 0;
  for (tmp = gc(); !isdigit(tmp); tmp = gc())
    key = (tmp == '-');
  for (; isdigit(tmp); tmp = gc()) 
    x = (x << 3) + (x << 1) + (tmp ^ '0');
  if (key) x = -x;
}
template <typename tp>
inline void ckmn(tp& x,tp y) {
  x = x < y ? x : y;
}
template <typename tp>
inline void ckmx(tp& x,tp y) {
  x = x < y ? y : x;
}

const int N = 510;
ll dp[N][N], n;
ll mat[N][N], sum[2][N][N];
ll calc(int tp,int l1,int r1,int l2,int r2) {
  return sum[tp][r1][r2] - sum[tp][l1-1][r2] - sum[tp][r1][l2-1] + sum[tp][l1-1][l2-1];
}
int main() {
  read(n);
  rep (i, 1, n) {
    rep (j, 1, n) if (i != j) {
      read(mat[i][j]);
    }
  }
  rep (i, 1, n) rep (j, 1, n)
    sum[i < j][i][j] = mat[i][j];
  rep (k, 0, 1) {
    rep (i, 1, n) rep (j, 1, n)
      sum[k][i][j] += sum[k][i][j-1];
    rep (i, 1, n) rep (j, 1, n)
      sum[k][i][j] += sum[k][i-1][j];
  }
  memset(dp, 0, sizeof dp);
  rep (i, 1, n) rep (j, 1, n) dp[0][0] += mat[i][j];
  // 1 >= qj + .. + q_{i-1} (i > j)
  rep (i, 1, n) {
    rep (a, 0, i-1) rep (b, 0, max(0, a-1)) {
      ckmx(dp[i][a], dp[a][b] - calc(1, a+1, i, a+1, i) - calc(0, i+1, n, b+1, a));
    }
  }
  ll ans = 0;
  rep (a, 0, n) rep (b, 0, max(0, a-1))
    ckmx(ans, dp[a][b] - calc(1, a+1, n, a+1, n));
  ans = dp[0][0] - ans;
  cout << ans << endl;
  return 0;
}
