1737: 【CSP循环】与7无关的数▃

Memory Limit:128 MB Time Limit:1.000 S
Judge Style:Text Compare Creator:
Submit:7 Solved:6

Description

一个整数,如果这个数能够被 lns="http://www.w3.org/1998/Math/MathML">7 整除,或者其中有一位是lns="http://www.w3.org/1998/Math/MathML">7,我们称为这个数是与 lns="http://www.w3.org/1998/Math/MathML">7 有关的数。比如: lns="http://www.w3.org/1998/Math/MathML">14 能被 lns="http://www.w3.org/1998/Math/MathML">7 整除,lns="http://www.w3.org/1998/Math/MathML">17 有一位为 lns="http://www.w3.org/1998/Math/MathML">7 ,这两个数都是与 lns="http://www.w3.org/1998/Math/MathML">7有关的数。

请你编程求出 lns="http://www.w3.org/1998/Math/MathML">1nn999 中,与 lns="http://www.w3.org/1998/Math/MathML">7 无关的数的总和是多少?

比如 lns="http://www.w3.org/1998/Math/MathML">110 中与 lns="http://www.w3.org/1998/Math/MathML">7 无关的数的和为:lns="http://www.w3.org/1998/Math/MathML">1+2+3+4+5+6+8+9+10=48 。

Input

一个整数 lns="http://www.w3.org/1998/Math/MathML">nn999 

Output

1n 中与 lns="http://www.w3.org/1998/Math/MathML">7 无关的数的总和。

Sample Input Copy

10

Sample Output Copy

48