letters

Problem Description

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.

Task Description

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.

Input

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

Output a single integer, which denotes the number of different ways Ranald can highlight the letters from A to Z.

Sample Input 1

abcdefgHiJklmnoPqRstUvwxYz

Sample Output 1

1

Sample Input 2

ababcdefghijklmnopqrstuvwxyz

Sample Output 2

3

Explanation for Sample Output 2

ababcdefghijklmnopqrstuvwxyz
ababcdefghijklmnopqrstuvwxyz
ababcdefghijklmnopqrstuvwxyz


Submitting .cpp to 'letters'


You're not logged in! Click here to login

Time Limit: 1 Seconds
Memory Limit: 256MB
Your best score: 0
Source: Dunjudge Archive

Subtask Score
1 100
2 0