Hrahc Likes 114514
该比赛已结束,您无法在比赛模式下递交该题目。您可以点击“在题库中打开”以普通模式查看和递交本题。
Description
Hrahc is a 24-year-old student. He likes a number very much.
Now Hrahc gets a string with numbers. He wants to know how many times the number appears as a subsequence (not substring, notice that subsequence is not required to be contiguous) in the string.
Format
Input
The first line contains a single integer , the length of the string.
The second line contains a string of length , consisting of digits from to .
Output
Only one integer: the number of times the number appears as a subsequence in the string.
Modulo 114514.
Samples
6
114514
1
7
1114514
3