#include <stdio.h>
#include <string.h>

int main(void){

    int N = 0;
    int count = 0;
    int sum = 0;
    int j = 0;
    scanf("%d", &N);

    char S[N][10];
    char tmpS[N][10];
    int check[20000] = {0};

    for (int i = 0; i < N; i++){
        scanf("%s", S[i]);

        while (S[i][j] != '\0'){
            sum += S[i][j];
            j++;
        }
        sum %= N;

        if (check[sum] == 0){
            check[sum]++;
            tmpS[sum] = S[i];

        } else if (strcmp(tmpS[sum], S[i]) == 0){
            check[sum]++;

        } else if (strcmp(tmpS[sum], S[i]) != 0){
            while (check[sum] == 0){
                sum++;

                if (sum >= N){
                    sum = 0;
                }
            }
            check[sum]++;
        }
        sum = 0;
        j = 0;
    }
 
    for (int k = 0; k < 20000; k++){
        if (check[k] != 0){
            count++;
        }
    }  
    printf("%d\n", count);

    return 0;
}