logo AlgoBeat OnlineJudge
登录 注册

#209498. [EC Final 2020] Namomo Subsequence

内存限制:1024 MiB 时间限制:3000 ms 标准输入输出
题目类型:VJudge(洛谷) 评测方式:VJudge
上传者: 匿名

题目描述

gshfd1jkhaRaadfglkjerVcvuy0gf said Prof. Pang.

To understand Prof. Pang's word, we would like to calculate the number of s of it. The word by Prof. Pang is a string with characters where each character is either an English letter (lower or upper case) or a digit. The -th character of is denoted by (). A subsequence of is defined by a list of indices such that . Let be a function on two characters such that when and otherwise. is a namomo subsequence of if and only if for any , , where represents the -th character of the string namomo ().

Output the number of namomo subsequences of a given string modulo .

输入格式

The first line contains a string with characters (). contains only lower case English letters (a -- z), upper case English letters (A -- Z) and digits (0 -- 9).

输出格式

Output one integer -- the answer modulo .

样例

样例输入 1

wohaha

样例输出 1

1

样例输入 2

momomo

样例输出 2

0

样例输入 3

gshfd1jkhaRaadfglkjerVcvuy0gf

样例输出 3

73

样例输入 4

retiredMiFaFa0v0

样例输出 4

33