Territoriality (problem name: stake.X) Farmer John's N (1 <= N <= 500) cows have recently become a bit territorial in a strange sort of way. The cows share a large square field that can be thought of as comprising N rows and N columns. The strange part is that FJ's cows refuse to share a row or column with another cow. FJ must find a way to place the cows in the field so that as many cows as possible are present, but so that no two cows are in the same row or column. To make matters worse, some of the field is bare rock, unsuitable for grazing. FJ cannot place cows there. FJ has been moving cows around all day but still has not found an arrangement that makes them all happy. In fact, Farmer John is unsure of _how many_ cows he can make happy: the cows and Farmer John are all getting a little frustrated with the process. Help Farmer John find the number of cows that can be placed on the field, so that FJ and the other cows can finally go home and watch their favorite daytime TV show, _As The Grass Grows_... . PROBLEM NAME: stake INPUT FORMAT: * Line 1: A single integer, N * Lines 2..N+1: N lines describing where the field is bare rock. Each line contains N space-separated 1's and 0's describing a single row of the field. A 1 indicates a grassy area, while a 0 indicates rock. SAMPLE INPUT: 4 1 0 1 1 0 1 0 0 0 0 0 1 0 1 0 1 OUTPUT FORMAT: * Line 1: output the largest number of cows that can be placed on the field SAMPLE OUTPUT: 3