Long time ago, in Fairy Meadows, not schoolchildren and teachers, but gnomes lived. Since then, some of the houses have been connected by underground tunnels. On this night, the gnomes plan to regain their ancient lands and capture all the SMS houses while the schoolchildren and teachers are asleep. Once in a house, the gnomes can freely move into any other house connected by a tunnel, then from there into houses connected to those, and so on. However, the teachers, having learned about this, closed the doors for the night. Now, the gnomes must break through some doors in order to seize the SMS.
Imagine yourself in the gnome's place and answer the question: how many minimum doors do they have to break?
The first line contains the number of houses (1 \le n \le 100) in the SMS. The next lines provide the description of tunnels in the form of a table—cell contains "1" if there exists a tunnel between houses and ; otherwise, it contains "0".
Print the minimum number of doors that the gnomes need to break.
Example 1