Programming contests

DEIK Regionális Programozó Csapatverseny, egyetemi kategória, 2023. december 3.

December 3, 2023, 10:00 AM – December 3, 2023, 3:30 PM

Different

Peter is reading verses, but got unfocused, and started think about a completely different matter: of how many different words a vers have? His thinking is a little bit strange: he takes two words eventually different if there is at least one letter that appears with different frequencies in the words. (otherwise he takes the words equal). Help him to compute that how many eventually different words (DD) are in a given list of words!

Input specification

In the first line there is a number NN, the number of words in the list. Then NN lines follow, each with a single word wiw_i. The words consist only of letters of English alphabet.

Output specification

A single line with the number DD.

Constraints

1N1000001\le N \le 100000
1lengthofwi421\le \ \mathrm{length\ of}\ w_i \le 42

Sample input 1

  1. 8
  2. a
  3. ab
  4. abc
  5. aabb
  6. bbaa
  7. abba
  8. bab
  9. cab
download as text file

Sample output 1

  1. 5
download as text file

Sample input 2

  1. 4
  2. apap
  3. papa
  4. app
  5. pap
download as text file

Sample output 2

  1. 2
download as text file

Sample input 3

  1. 6
  2. abc
  3. acb
  4. bac
  5. abc
  6. cab
  7. cba
download as text file

Sample output 3

  1. 1
download as text file
University of Debrecen; Faculty of Informatics; v. 09/30/2024