Codeforces Round 136 (Div. 2)
B
Little Elephant and Numbers
Codeforces
1300
原题
← AC →
翻译中…

The Little Elephant loves numbers.

翻译中…

He has a positive integer $*x*$. The Little Elephant wants to find the number of positive integers $*d*$, such that $*d*$ is the divisor of $*x*$, and $*x*$ and $*d*$ have at least one common (the same) digit in their decimal representations.

翻译中…

Help the Little Elephant to find the described number.

翻译中…

Input

翻译中…

A single line contains a single integer $*x*$ $(1 ≤ *x* ≤ 10^{9})$.

翻译中…

Output

翻译中…

In a single line print an integer — the answer to the problem.

翻译中…

样例

Input #1
1
Output #1
1
InputCopy OutputCopy
Input #2
10
Output #2
2
InputCopy OutputCopy
题目信息
题号
221B
时间限制
2 s
内存限制
256 MB
标签
模拟

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。