How many words
Easy
Execution time limit is 1 second
Runtime memory usage limit is 64 megabytes
Consider a sequence consisting of all possible words of length N, where the letters A, B, C can appear in even positions, and the letters D, E can appear in odd positions. The positions in the words are numbered from left to right, starting at 0. This sequence is arranged in lexicographical order. Given two words from this sequence, your task is to determine how many words in the sequence fall strictly between these two words.
Constraints
0 < N ≤ 48.
Input
The input consists of two lines: the first line contains the first word, and the second line contains the second word. Both words have the same length.
Output
Output a single line with the number of words that are strictly between the two given words in the sequence.
Examples
Input #1
Answer #1
Input #2
Answer #2
Submissions 46
Acceptance rate 37%