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