#include<iostream>
#include<algorithm>
using namespace std;
long long x[100][100], n, sum;
int main() {
	cin >> n;
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < n; j++) {
			cin >> x[i][j];
		}
	}
	for (int i = 0; i < n; i++) {
		for (int j = i + 1; j < n; j++) {
			sum += min(x[i][j], x[j][i]);
		}
	}
	cout << sum << endl;
	return 0;
}