#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;

#define fi first
#define se second
#define repl(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++)
#define rep(i,n) repl(i,0,n)
#define all(x) (x).begin(),(x).end()
#define dbg(x) cout<<#x"="<<x<<endl
#define mmax(x,y) (x>y?x:y)
#define mmin(x,y) (x<y?x:y)
#define maxch(x,y) x=mmax(x,y)
#define minch(x,y) x=mmin(x,y)
#define uni(x) x.erase(unique(all(x)),x.end())
#define exist(x,y) (find(all(x),y)!=x.end())
#define bcnt __builtin_popcountll

#define INF 1e16
#define mod 1000000007

ll N;
ll A[510][510];
ll lpsum[510][510];
ll psum[510][510],nsum[510][510];
ll dp[510][510];

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);

  cin>>N;
  ll tot=0;
  rep(i,N){
    rep(j,N){
      if(i==j)continue;
      cin>>A[i][j];
      tot+=A[i][j];
    }
  }

  rep(i,N){
    repl(j,i+1,N){
      lpsum[i][j]=lpsum[i][j-1]+A[j][i];
    }
    for(ll j=i-1;j>=0;j--){
      psum[j][i]=psum[j+1][i]+A[i][j];
    }
    for(ll j=i-1;j>=0;j--){
      nsum[j][i]=nsum[j+1][i]+A[j][i];
    }
  }

  ll res=0;
  rep(i,N)rep(j,N)dp[i][j]=-INF;
  repl(i,1,N){
    dp[i][0]=psum[0][i]+nsum[0][i];
    for(ll j=i-1;j>=0;j--){
      dp[i][0]+=psum[0][j];
    }

    ll crt=dp[i][0];
    repl(k,i+1,N){
      crt+=nsum[0][k]-nsum[i][k];
      crt+=psum[0][k];
    }
    maxch(res,crt);
  }

  repl(i,1,N)repl(j,1,i){
    ll vp=psum[j][i];
    for(ll k=i-1;k>=j;k--){
      vp+=lpsum[k][i-1];
    }
    ll vn=nsum[0][i];
    for(ll k=i-1;k>j;k--){
      vn+=nsum[0][k]-nsum[j][k];
    }
    for(ll k=j-1;k>=0;k--){
      vp+=lpsum[k][i-1]-lpsum[k][j];
      maxch(dp[i][j],dp[j][k]+vp+vn);
    }

    ll crt=dp[i][j];
    repl(k,i+1,N){
      crt+=nsum[0][k]-nsum[i][k];
      crt+=psum[j][k];
    }
    maxch(res,crt);
  }

  cout<<tot-res<<endl;

  return 0;
}
