Little Mirko is studying the hash function which associates numerical values to words. The function is defined recursively in the following way:
- empty word
- word letterwordletter
The function is defined for words that consist of only lowercase letters of the English alphabet. stands for the bitwise XOR operator (e.g. ), letter stands for the ordinal number of the letter in the alphabet (a
, z
) and stands for the remainder of the number when performing integer division with the number . will be an integer of the form .
Some values of the hash function when :
a
aa
kit
Mirko wants to find out how many words of length there are with the hash value . Write a programme to help him calculate this number.
Input Specification
The first line of input contains three integers , and .
Output Specification
The first and only line of output must consist of the required number from the task.
Scoring
In test cases worth of total points, will not exceed .
Additionally, in test cases worth of total points, will not exceed .
Sample Input 1
1 0 10
Sample Output 1
0
Explanation for Sample Output 1
None of the characters in the alphabet has an ord value .
Sample Input 2
1 2 10
Sample Output 2
1
Explanation for Sample Output 2
It is the word b
.
Sample Input 3
3 16 10
Sample Output 3
4
Explanation for Sample Output 3
Those are the words dxl
, hph
, lxd
and xpx
.
Comments