from itertools import * print(len(set(permutations(input())))-1)