#include <bits/stdc++.h>
using namespace std;
int main()
{
    int a=0,b=0,c=0,d=0,e=0;
    cin>>a;
    for(int i=1;i<=a;i++)
    {
        b=i%7;
        c=i%10;
        d=i/10;
        if(b>0 && c!=7 && d!=7)
        {
            e=e+i*i;
        }
    }
    cout<<e;
    return 0;
}

0 comments

No comments so far...