#include<bits/stdc++.h>
using namespace std;
typedef pair<int, int> PII;
const int N = 205;
int n;
vector<PII> p[N];
int dijkstra() {
vector<int> dist(n, 0x3f3f3f3f);
dist[1] = 0;
priority_queue<PII, vector<PII>, greater<PII>> q;
q.emplace(0, 1);
while (!q.empty()) {
int ver = q.top().second, dis = q.top().first;
q.pop();
if (dis > dist[ver]) continue;
for (auto x : p[ver]) {
int u = x.first;
int w = x.second;
if (dist[u] > dist[ver] + w) {
dist[u] = dist[ver] + w;
q.emplace(dist[u], u);
}
}
}
return dist[n];
}
void solve() {
cin >> n;
for (int i = 1; i <= n; i ++ ) {
for (int j = i + 1; j <= n; j ++ ) {
int x;
cin >> x;
p[i].push_back({j, x});
}
}
cout << dijkstra() << '\n';
}
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
int t = 1;
while (t -- ) {
solve();
}
return 0;
}