from yogi import scan

n = scan(int)
while n is not None:
    print("1" if es_equilibrat(n) else "0")
    n = scan(int)
