Ranald the cat is reading his Geography notes and he got bored. He takes his highlighter and decides to highlight letters, in alphabetical order, A to Z.
One example is: Absolute cat does fishing, hill jack lame nope quick rest you vista while fax you zebra.
Given the paragraph (with spaces and punctuations) on a single line, output the total number of different ways Ranald can highlight the letters from A to Z.
The answer will be able to fit into a 64-bit unsigned integer.
For 50% of the testcases, the length of the string will be not more than 1000.
For 75% of the testcases, the length of the string will be not more than 40000.
For 100% of the testcases, the length of the string will not be more than 1000000.
Output a single integer, which denotes the number of different ways Ranald can highlight the letters from A to Z.
abcdefgHiJklmnoPqRstUvwxYz
1
ababcdefghijklmnopqrstuvwxyz
3
Subtask | Score |
---|---|
1 | 100 |
2 | 0 |