P20522 [HackerEarth] Seeing all other business tycoons from Gotham attending Vibrant Gujarat 2015, Bruce Wayne felt left out and decided he too would attend the summit. He asked Alfred to arrange passes for
普及
题目描述

Seeing all other business tycoons from Gotham attending Vibrant Gujarat 2015, Bruce Wayne felt left out and decided he too would attend the summit. He asked Alfred to arrange passes for him but was too late. The passes were all sold out. He later found out that a man named Falcone was selling passes on the black market.

Wayne went to Falcone to get those passes but Falcone refused. It wasn't money that Falcone desired, he just wanted to have a little bit of fun. In order to earn those passes, Bruce Wayne would have to solve a given number of, say N, sudoku puzzles and tell Falcone the sum of the numbers on the main diagonals of all the puzzles in order to get those passes.

Help Bruce solve this question so that he can get those passes from Falcone to attend this summit.

Sum = 39

Input:
The first line of input would consist of a number N, the number of sudoku puzzles. Next Nx9 lines would contain the puzzles in the specified format.

Output:
A single number which is the sum of all the numbers on the main diagonals of all the given puzzles.

Constraints:
1 ≤ N ≤ 10

Note:
There is NO blank line between two consecutive input puzzles.

SAMPLE INPUT
1
003020600
900305001
001806400
008102900
700000008
006708200
002609500
800203009
005010300

SAMPLE OUTPUT
39

输入格式

见题面

输出格式

见题面

样例输入
10 003020600 900305001 001806400 008102900 700000008 006708200 002609500 800203009 005010300 200080300 060070084 030500209 000105408 000000000 402706000 301007040 720040060 004010003 000000907 000420180 000705026 100904000 050000040 000507009 920108000 034059000 507000000 030050040 008010500 460000012 070502080 000603000 040109030 250000098 001020600 080060020 020810740 700003100 090002805 009040087 400208003 160030200 302700060 005600008 076051090 100920000 524010000 000000070 050008102 000000000 402700090 060000000 000030945 000071006 043080250 600000000 000001094 900004070 000608000 010200003 820500000 000000005 034090710 480006902 002008001 900370060 840010200 003704100 001060049 020085007 700900600 609200018 000900002 050123400 030000160 908000000 070000090 000000205 091000050 007439020 400007000 001900003 900700160 030005007 050000009 004302600 200000070 600100030 042007006 500006800
样例输出
423