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

#define for_(i,a,b) for(int i=a;i<b;++i)
#define for_rev(i,a,b) for(int i=a;i>=b;--i)
#define allof(a) a.begin(),a.end()
#define minit(a,b) memset(a,b,sizeof(a))
#define size_of(a) (int)a.size()

typedef long long lint;
typedef pair<int, int> pii;
typedef double Double;

inline int POPCNT(int _x) { return __builtin_popcount(_x); }
inline int POPCNT(lint _x) { return __builtin_popcountll(_x); }

const int iINF = 1L << 30;
const lint lINF = 1LL << 60;
const Double EPS = 1e-9;

int N;
lint C[110][110];

int main() {
	cin >> N;
	for_(i,0,N) for_(j,0,N) cin >> C[i][j];
	lint ans = 0;
	for_(i,0,N) for_(j,i + 1, N) ans += min(C[i][j], C[j][i]);
	cout << ans << endl;
	return 0;
}