include [HTML_REMOVED]
define NUM 10000
using namespace std;
int main()
{
int n;
scanf(“%d”,&n);
int sum=0;
for(int i=1;i<=n;i++)
{
int temp=i;
while(temp>0)
{
int t=temp%10;
if(t== 2 || t==0 || t==1 || t==9)
{
sum+=i;
break;
}
temp=temp/10;
}
}
printf(“%d”,sum);
return 0;
}