#B2081. Sum of Squares of Non-7-Related Numbers

    ID: 11163 Type: Default 1000ms 256MiB

Sum of Squares of Non-7-Related Numbers

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

inputFormat

The input contains a single integer \(n\) where \(1 \leq n < 100\).

outputFormat

Output the sum of squares of all positive integers \(\leq n\) that are not 7-related.

sample

10
336