import java.util.Scanner; import java.util.TreeSet; public class Main { static boolean memo[]; static int ans, min; public static void main(String[] args) { Scanner sc = new Scanner(System.in); StringBuilder sb = new StringBuilder(); int n = sc.nextInt(); char[][] score = new char[n][n]; for (int i = 0; i < n; i++) { score[i] = sc.next().toCharArray(); } int win[] = new int[n]; for (int i = 1; i < n; i++) { if (score[0][i] == '-') { score[0][i] = 'o'; score[i][0] = 'x'; win[0]++; } else if (score[0][i] == 'o') { win[0]++; } } for (int i = 1; i < n; i++) { for (int j = 0; j < n; j++) { if (score[i][j] == 'o') { win[i]++; } } } for (int i = 1; i < n; i++) { for (int j = 0; j < n; j++) { if (score[i][j] == '-') { if (win[i] >= win[j]) { score[i][j] = 'x'; score[j][i] = 'o'; win[j]++; } else { score[i][j] = 'o'; score[j][i] = 'x'; win[i]++; } } } } TreeSet hs = new TreeSet<>(); for (int i = 0; i < n; i++) { hs.add(win[i]); } int cnt = 0; for (int i : hs) { if (i == win[0]) { System.out.println(hs.size() - cnt); break; } cnt++; } } }