usingnamespace std; constint N = 505; char str[N][30]; int match[N]; bool vis[N]; vector<int> g[N];
boolcheck(char s[], char str[], int n){ int num = 0; for (int i = 0; i < n; i++) if (s[i] != str[i]) num++; return num == 2; }
booldfs(int u){ for (int i = 0, v; i < g[u].size(); i++) { if (!vis[v = g[u][i]]) { vis[v] = true; if (!match[v] || dfs(match[v])) { match[v] = u; returntrue; } } } returnfalse; }
intGet(int n){ memset(match, 0, sizeof match); int num = 0; for (int i = 1; i <= n; i++) { memset(vis, 0, sizeof vis); if (dfs(i)) num++; } return num / 2; }
intmain(){ int n; cin >> n; for (int i = 1; i <= n; i++) { scanf("%s", str[i]); } int len = strlen(str[1]); for (int i = 1; i <= n; i++) for (int j = 1; j < i; j++) if (check(str[i], str[j], len)) { g[i].push_back(j); g[j].push_back(i); } int res = n - Get(n); printf("%d\n", res); return0; }