Ancient manuscripts#610

Ancient manuscripts

1.5 seconds
128 megabytes
Easy

In some ancient country, there lived brothers. We do not know exactly how many of them there were, but historical sources mention that there were at least . Over time, they had children who spread all over the world, and like their parents, each of them built their own city. As time passed, the number of relatives increased rapidly, and they decided to build roads between some of the cities. Some of them had even managed to build circular roads around their own city earlier. The manuscripts mention that the number of cities in that country did not exceed . In addition, the manuscripts include schematic maps that showed the presence of roads between the cities or a bypass road around a city. The maps are in the form of square matrices, where a digit indicates the presence of a road between cities, or a circular road around a city, and indicates the absence of such a road.

Study the ancient manuscripts and answer the question: how many roads have been built between the cities?

Input

The first line contains the number of cities , and each of the next lines contains numbers separated by spaces, which indicate the presence or absence of a corresponding road.

Output

Print the number of roads built between the cities.

Examples

Example 1

Loading
Loading