HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Contests > Bil-273 Arasinav > problem:


2. Cities and roads

Bil-273 Arasinav

Start: Nov.12.2018 at 09:25:00 AM
Finish: Nov.16.2018 at 12:05:00 PM
The contest is finished!
• Contest scoreboard

Contest problems

• 1. Sultan's game
• 2. Cities and roads
• 3. Простая задача

Feedback

If you notice incorrect translations in Contester, please let author know.

Time limit 1000/1000/1000/1000 ms. Memory limit 65000/65000/65000/65000 Kb.

Problem description

Given N cities and some of them are connected with roads. Calculate number of roads.

Input

There is a single integer N on the first line (0 ≤ N ≤ 100). There are N integers 1 or 0 on each of N next lines. Where (i, j) = 1 if cities i and j are connected and 0 otherwise.

Output

Write number of roads.

Example

stdin stdout

5
0 1 0 0 0
1 0 1 1 0
0 1 0 0 0
0 1 0 0 0
0 0 0 0 0

3

Для отправки решений необходимо выполнить вход.

www.contester.ru