/* package whatever; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
{
int num01 = 1;
int sum =0;
int cnt = 2;
int temp = 0;
int sel = 0;
int cal = 0;
int num = 400;
for(int i = 1; num01<=num; i++){
cal = 0;
temp = num01;
while(temp!=0){
sel = num01%10;
temp = temp/10;
if(sel == 5){
cal++;
}
}
if(cal == 0){
sum = sum+num01;
}
num01+=(cnt*cnt);
cnt++;
}
}
}
LyogcGFja2FnZSB3aGF0ZXZlcjsgLy8gZG9uJ3QgcGxhY2UgcGFja2FnZSBuYW1lISAqLwoKaW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CgovKiBOYW1lIG9mIHRoZSBjbGFzcyBoYXMgdG8gYmUgIk1haW4iIG9ubHkgaWYgdGhlIGNsYXNzIGlzIHB1YmxpYy4gKi8KY2xhc3MgSWRlb25lCnsKCXB1YmxpYyBzdGF0aWMgdm9pZCBtYWluIChTdHJpbmdbXSBhcmdzKSB0aHJvd3MgamF2YS5sYW5nLkV4Y2VwdGlvbgoJewoJCWludCBudW0wMSA9IDE7CmludCBzdW0gPTA7CmludCBjbnQgPSAyOwppbnQgdGVtcCA9IDA7CmludCBzZWwgPSAwOwppbnQgY2FsID0gMDsKaW50IG51bSA9IDQwMDsKZm9yKGludCBpID0gMTsgbnVtMDE8PW51bTsgaSsrKXsKY2FsID0gMDsKdGVtcCA9IG51bTAxOwp3aGlsZSh0ZW1wIT0wKXsKc2VsID0gbnVtMDElMTA7CnRlbXAgPSB0ZW1wLzEwOwppZihzZWwgPT0gNSl7CmNhbCsrOwp9Cn0KaWYoY2FsID09IDApewpzdW0gPSBzdW0rbnVtMDE7Cgp9Cm51bTAxKz0oY250KmNudCk7CmNudCsrOwp9ClN5c3RlbS5vdXQucHJpbnQoc3VtKTsKfQp9IA==