#Z14404. 与7无关的数

与7无关的数

Description

A positive integer is called a 7-related number if it is divisible by 7 or any digit in its decimal representation is 7. Now, find the sum of the squares of all positive integers less than or equal to n (where n < 100) that are not 7-related numbers.

Input Format

The input consists of a single line containing a positive integer n (n < 100).

Output Format

Output a single line containing an integer, which is the sum of the squares of all positive integers less than or equal to n that are not 7-related numbers.

21

2336