#include <bits/stdc++.h>
using namespace std;
bool isPrime(long long n) {
  if (n <= 1) return false;
  for (long long i = 2; i < n; i++)
    if (n % i == 0) return false;
  return true;
}
long long SieveOfEratosthenes(long long n, long long a) {
  bool prime[n + 1];
  memset(prime, true, sizeof(prime));
  for (long long p = 2; p * p <= n; p++) {
    if (prime[p] == true) {
      for (long long i = p * p; i <= n; i += p) prime[i] = false;
    }
  }
  for (long long p = 2; p <= n; p++)
    if (prime[p]) {
      if (a % p == 0) {
        return (a - p);
      }
    }
}
long long nCr(int n, int r) {
  if (r > n - r) r = n - r;
  long long ans = 1;
  int i;
  for (i = 1; i <= r; i++) {
    ans *= n - r + i;
    ans /= i;
  }
  return ans;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long a, b, c, d, e, g, h, n, t, f, k, l, m,
      f1 = 0, flag = 0, flag1 = 0, co = 0, co1 = 0, co2 = 0, arr[101][101],
      arr1[100001] = {0}, sum = 0, sum1 = 0, ma = 0, ma1 = 0,
      mi = 1000000000000000001;
  long long co3 = 0, co4 = 0, co5 = 0, co6 = 0, co7 = 0, co8 = 0, mul = 1,
            sum2 = 0, sum3 = 0;
  long long MOD = 1e9 + 7;
  double pi = 2 * acos(0.0);
  string str, str1, str2, str3;
  char ch, ch1;
  vector<long long> v;
  vector<long long> v1;
  vector<string> vs;
  vector<string> vs1;
  map<char, long long> mp;
  map<char, int> mp1;
  set<long long> s;
  set<long long> s1;
  list<long long> li;
  list<long long>::iterator it;
  queue<long long> q;
  vector<pair<long long, long long> > v3;
  int x[] = {1, 1, 1, 0, 0, -1, -1, -1};
  int y[] = {0, 1, -1, 1, -1, 1, -1, 0};
  cin >> n;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) cin >> arr[i][j];
  }
  for (int i = 0; i < n; i++) {
    if (i == n / 2) continue;
    sum += arr[i][i];
  }
  for (int i = 0; i < n; i++) {
    if (i == n / 2) continue;
    sum += arr[i][(n - i) - 1];
  }
  for (int i = 0; i < n; i++) {
    if (i == n / 2) continue;
    sum += arr[i][n / 2];
  }
  for (int i = 0; i < n; i++) {
    if (i == n / 2) continue;
    sum += arr[n / 2][i];
  }
  sum += arr[n / 2][n / 2];
  cout << sum << endl;
  return 0;
}

### Prompt

Your challenge is to write a cpp solution to the following problem:

The Smart Beaver from ABBYY got hooked on square matrices. Now he is busy studying an n × n size matrix, where n is odd. The Smart Beaver considers the following matrix elements good: 

  * Elements of the main diagonal. 
  * Elements of the secondary diagonal. 
  * Elements of the "middle" row — the row which has exactly <image> rows above it and the same number of rows below it. 
  * Elements of the "middle" column — the column that has exactly <image> columns to the left of it and the same number of columns to the right of it. 

<image> The figure shows a 5 × 5 matrix. The good elements are marked with green. 

Help the Smart Beaver count the sum of good elements of the given matrix.

Input

The first line of input data contains a single odd integer n. Each of the next n lines contains n integers aij (0 ≤ aij ≤ 100) separated by single spaces — the elements of the given matrix.

The input limitations for getting 30 points are: 

  * 1 ≤ n ≤ 5



The input limitations for getting 100 points are:

  * 1 ≤ n ≤ 101

Output

Print a single integer — the sum of good matrix elements.

Examples

Input

3
1 2 3
4 5 6
7 8 9


Output

45


Input

5
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1


Output

17

Note

In the first sample all matrix elements will be good. Good elements in the second sample are shown on the figure.

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
bool isPrime(long long n) {
  if (n <= 1) return false;
  for (long long i = 2; i < n; i++)
    if (n % i == 0) return false;
  return true;
}
long long SieveOfEratosthenes(long long n, long long a) {
  bool prime[n + 1];
  memset(prime, true, sizeof(prime));
  for (long long p = 2; p * p <= n; p++) {
    if (prime[p] == true) {
      for (long long i = p * p; i <= n; i += p) prime[i] = false;
    }
  }
  for (long long p = 2; p <= n; p++)
    if (prime[p]) {
      if (a % p == 0) {
        return (a - p);
      }
    }
}
long long nCr(int n, int r) {
  if (r > n - r) r = n - r;
  long long ans = 1;
  int i;
  for (i = 1; i <= r; i++) {
    ans *= n - r + i;
    ans /= i;
  }
  return ans;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long a, b, c, d, e, g, h, n, t, f, k, l, m,
      f1 = 0, flag = 0, flag1 = 0, co = 0, co1 = 0, co2 = 0, arr[101][101],
      arr1[100001] = {0}, sum = 0, sum1 = 0, ma = 0, ma1 = 0,
      mi = 1000000000000000001;
  long long co3 = 0, co4 = 0, co5 = 0, co6 = 0, co7 = 0, co8 = 0, mul = 1,
            sum2 = 0, sum3 = 0;
  long long MOD = 1e9 + 7;
  double pi = 2 * acos(0.0);
  string str, str1, str2, str3;
  char ch, ch1;
  vector<long long> v;
  vector<long long> v1;
  vector<string> vs;
  vector<string> vs1;
  map<char, long long> mp;
  map<char, int> mp1;
  set<long long> s;
  set<long long> s1;
  list<long long> li;
  list<long long>::iterator it;
  queue<long long> q;
  vector<pair<long long, long long> > v3;
  int x[] = {1, 1, 1, 0, 0, -1, -1, -1};
  int y[] = {0, 1, -1, 1, -1, 1, -1, 0};
  cin >> n;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) cin >> arr[i][j];
  }
  for (int i = 0; i < n; i++) {
    if (i == n / 2) continue;
    sum += arr[i][i];
  }
  for (int i = 0; i < n; i++) {
    if (i == n / 2) continue;
    sum += arr[i][(n - i) - 1];
  }
  for (int i = 0; i < n; i++) {
    if (i == n / 2) continue;
    sum += arr[i][n / 2];
  }
  for (int i = 0; i < n; i++) {
    if (i == n / 2) continue;
    sum += arr[n / 2][i];
  }
  sum += arr[n / 2][n / 2];
  cout << sum << endl;
  return 0;
}

```