#include <bits/stdc++.h>
using namespace std;
int i, j, m, n, p, k, a[1005][1005], vis[1005][1005], ans;
int main() {
  scanf("%d", &n);
  for (i = 1; i <= n; ++i)
    for (j = 1; j <= n; ++j) scanf("%d", &a[i][j]);
  for (i = 1; i <= n; ++i) vis[i][(n + 1) / 2] = vis[(n + 1) / 2][i] = 1;
  for (i = 1; i <= n; ++i) vis[i][i] = vis[i][n - i + 1] = 1;
  for (i = 1; i <= n; ++i)
    for (j = 1; j <= n; ++j)
      if (vis[i][j]) ans += a[i][j];
  printf("%d\n", ans);
}
