Problem3111--小明的幸运数

3111: 小明的幸运数

[Creator : ]
Time Limit : 1.000 sec  Memory Limit : 128 MiB

Description

所有个位数为 lns="http://www.w3.org/1998/Math/MathML"> 的正整数,以及所有 lns="http://www.w3.org/1998/Math/MathML"> 的倍数,都被小明称为"lns="http://www.w3.org/1998/Math/MathML"> 幸运数”。小明想知道正整数 lns="http://www.w3.org/1998/Math/MathML"> 和 lns="http://www.w3.org/1998/Math/MathML"> 之间(包括 lns="http://www.w3.org/1998/Math/MathML"> 和 lns="http://www.w3.org/1998/Math/MathML">)所有 lns="http://www.w3.org/1998/Math/MathML"> 幸运数的和,你能帮帮他吗?

Input

输入 lns="http://www.w3.org/1998/Math/MathML">3 行。第一行包含一个正整数 lns="http://www.w3.org/1998/Math/MathML">,第二行包含一个正整数 lns="http://www.w3.org/1998/Math/MathML">,第三行包含一个正整数 lns="http://www.w3.org/1998/Math/MathML">。约定 lns="http://www.w3.org/1998/Math/MathML">29lns="http://www.w3.org/1998/Math/MathML">11000

Output

输出 lns="http://www.w3.org/1998/Math/MathML">1 行,符合题意的幸运数之和

Sample Input Copy

7
1
10

Sample Output Copy

7

样例解释 1
1 和 10之间共有 1 个 7 幸运数:7, 因为 7 既是 7 的倍数,个位数又为 7.因此,结果为 7。

HINT

样例输入2:
7
10
20
样例输出2:
31
样例解释 2
10和20之间共有2个7幸运数:14和17。14是7的倍数,17的个位数为7.因此结果为31

Source/Category