f={case 0->0 case x->m=x%10;f((x-m)/10)*2+m} stdin|{x->if(sqrt(f(number(x))*8+1)%1>0)0else 1}|puts