import java.io.*;
public class Main {
public static void main(String[] args) throws NumberFormatException, IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int N = Integer.parseInt(br.readLine());
int count = 0;
next: for (int test_case = 0; test_case < N; test_case++) {
String str = br.readLine();
String temp = "";
for (int i = 0; i < str.length(); i++) {
char c = str.charAt(i);
if (temp.contains(c + "")) {
if (temp.charAt(temp.length() - 1) == c) temp += c;
else continue next;
} else temp += c;
}
count++;
}
System.out.println(count);
}
}