#include <bits/stdc++.h>
int a[102][102];
int b[102][102];
int main() {
  int N;
  scanf("%d", &N);
  for (int i = 0; i < N; i++)
    for (int j = 0; j < N; j++) scanf("%d", &a[i][j]);
  long long sum = 0;
  for (int i = 0, j = 0; i < N && j < N; i++, j++) sum += a[i][j], b[i][j]++;
  for (int i = N - 1, j = 0; i >= 0 && j < N; j++, i--)
    sum += a[i][j], b[i][j]++;
  N--;
  for (int i = 0; i <= N; i++)
    sum += a[i][int(N / 2)] + a[int(N / 2)][i], b[i][int(N / 2)]++,
        b[int(N / 2)][i]++;
  for (int i = 0; i <= N; i++)
    for (int j = 0; j <= N; j++)
      if (b[i][j] > 1) sum -= (b[i][j] - 1) * a[i][j];
  printf("%lld", sum);
  return 0;
}
