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.
 import java.util.*;


public class Project1{
  static void solutionP2(){}
   static void selectionsort(int[] a){
        int t,ind;
        for (int i = 0; i < a.length; i++) {
            ind=i;
            for (int j = i+1; j < a.length; j++) {
            if(a[j]<a[i]){ind=j;}    
            }
            t=a[ind];a[ind]=a[i];a[i]=t;
        }
        for (int i : a) {
            System.out.print(i+" ");
        }
    }
  static void solutionP1(){solutionP2();}
   static void bubblesort(int [] a){
       int t,flag;
       for (int i = 1; i < a.length; i++) {
           flag=0;
           for (int j =0; j <a.length-i; j++) {
               if(a[j]>a[j+1]){t=a[j+1];a[j+1]=a[j];a[j]=t;flag=1;}
           }
          if(flag==0)break;
       }
       for (int i :a) {
           System.out.print(i+" ");
       }
   }
   static void fun(){
       solutionP1();
   }
   static void insertionsort(int[]a){
       List<Integer>list=new ArrayList();
       list.add(0,a[0]);
       int ind=0;
       for (int i = 1; i < a.length; i++) {
         ind=0;
       
           while(a[i]>list.get(ind)&&ind<list.size()){ind++;}
           list.add(ind,a[i]);
         
       }
       System.out.println(list);
   }
 //merge sort
   
   // Merges two subarrays of arr[]. 
    // First subarray is arr[l..m] L(index) to m
    // Second subarray is arr[m+1..r] m+one to r
   static void merge(int arr[], int l, int m, int r) 
    { 
        // Find sizes of two subarrays to be merged 
        int n1 = m - l + 1; 
        int n2 = r - m; 
  
        /* Create temp arrays */
        int L[] = new int [n1]; 
        int R[] = new int [n2]; 
  
        /*Copy data to temp arrays*/
        for (int i=0; i<n1; ++i) 
            L[i] = arr[l + i]; 
        for (int j=0; j<n2; ++j) 
            R[j] = arr[m + 1+ j]; 
  
  
        /* Merge the temp arrays */
  
        // Initial indexes of first and second subarrays 
        int i = 0, j = 0; 
  
        // Initial index of merged subarry array 
        int k = l; 
        while (i < n1 && j < n2) 
        { 
            if (L[i] <= R[j]) 
            { 
                arr[k] = L[i]; 
                i++; 
            } 
            else
            { 
                arr[k] = R[j]; 
                j++; 
            } 
            k++; 
        } 
  
        /* Copy remaining elements of L[] if any */
        while (i < n1) 
        { 
            arr[k] = L[i]; 
            i++; 
            k++; 
        } 
  
        /* Copy remaining elements of R[] if any */
        while (j < n2) 
        { 
            arr[k] = R[j]; 
            j++; 
            k++; 
        } 
    } 
  
    // Main function that sorts arr[l..r] using 
    // merge() 
   static void sort(int arr[], int l, int r) 
    { 
        if (l < r) 
        { 
            // Find the middle point 
            int m = (l+r)/2; 
  
            // Sort first and second halves 
            sort(arr, l, m); 
            sort(arr , m+1, r); 
  
            // Merge the sorted halves 
            merge(arr, l, m, r); 
        } 
    } 
  
    /* A utility function to print array of size n */
    static void printArray(int arr[]) 
    { 
        int n = arr.length; 
        for (int i=0; i<n; ++i) 
            System.out.print(arr[i] + " "); 
        System.out.println(); 
    } 
  
    // Driver method 
    public static void main(String[] args) {
            Scanner sc=new Scanner(System.in);
            int n=sc.nextInt(),sum=0;sc.nextLine();
            int[][]a=new int[n][n];
            for (int i = 0; i < n; i++) {
                for (int j = 0; j < n; j++) {
                    a[i][j]=sc.nextInt();
                    if(j==(n-1)/2){sum+=a[i][j];}
                    else if(i==(n-1)/2){sum+=a[i][j];}
                    else if(j==i){sum+=a[i][j];}
                    else if(i+j==n-1){sum+=a[i][j];}
                }
        }
            
            System.out.println(sum);
    }
    
}