#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  while (scanf("%d", &n) != EOF) {
    int a[n][n];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < n; j++) {
        scanf("%d", &a[i][j]);
      }
    }
    if (n == 1) {
      printf("%d\n", a[0][0]);
      break;
    }
    int sum = 0;
    for (int i = 1; i < n - 1; i++) {
      for (int j = 1; j < n - 1; j++) {
        sum += a[i][j];
      }
    }
    sum += a[0][0] + a[0][n - 1] + a[n - 1][n - 1] + a[n - 1][0];
    sum += a[0][(n - 1) / 2] + a[n - 1][(n - 1) / 2] + a[(n - 1) / 2][0] +
           a[(n - 1) / 2][n - 1];
    printf("%d\n", sum);
  }
}
