from collections import * def f(s): if s == "l": return 1 elif s == "o": return 0 elif s == "a": return "@" elif s == "s": return "$" else: return s def check(L): if "@" not in L and "$" not in L: return False D = defaultdict(int) for a in L: D[a] += 1 val = 0 for i in range(10): val += D[i] if val == 0: return False alp = "abcdefghijklmnopqrstuvwxyz" val = 0 for i in alp: val += D[i] if val == 0: return False return True S = list(input()) N = len(S) SS = set() for s in range(1 << N): temp = [None] * N for i in range(N): if (s >> i) & 1: temp[i] = S[i] else: temp[i] = f(S[i]) if check(temp): SS.add(tuple(temp)) print(len(SS))