import itertools S = input().strip() # Generate possible replacements for each character choices = [] for c in S: if c == 'l': choices.append(['l', '1']) elif c == 'o': choices.append(['o', '0']) elif c == 'a': choices.append(['a', '@']) elif c == 's': choices.append(['s', '$']) else: choices.append([c]) count = 0 # Iterate over all possible combinations of replacements for chars in itertools.product(*choices): has_lower = False has_digit = False has_symbol = False for c in chars: if c.islower(): has_lower = True elif c.isdigit(): has_digit = True else: # c must be '@' or '$' has_symbol = True if has_lower and has_digit and has_symbol: count += 1 print(count)