#include <bits/stdc++.h>
using namespace std;
#define FOR(i,k,n) for(int i = (k); i < (n); i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(a) begin(a),end(a)
#define MS(m,v) memset(m,v,sizeof(m))
#define D10  fixed<<setprecision(10)
typedef vector<int> vi;
typedef vector<string> vs;
typedef pair<int, int> P;
typedef complex<double> Point;
typedef long long ll;
const int INF = 114514810;
const int MOD = 1000000007;
const double EPS = 1e-8;
const double PI = acos(-1.0);
struct edge
{
	int from, to, cost;
	bool operator < (const edge& e) const { return cost < e.cost; }
	bool operator >(const edge& e) const { return cost > e.cost; }
};
///*************************************************************************************///
///*************************************************************************************///
///*************************************************************************************///

int cost[105][105];
int main()
{
	int n;
	cin >> n;
	REP(i, n)REP(j, n)
	{
		int t;
		cin >> t;
		cost[i][j] = t;
	}
	ll sum = 0;
	REP(i, n)
	{
		FOR(j, i + 1, n)
		{
			sum += min(cost[i][j], cost[j][i]);
		}
	}
	cout << sum << endl;
	return 0;
}