import sys input = sys.stdin.readline a=input().strip() A="" for x in a: if x==".": continue A+=x a=int(A) ANS=0 x=0 y=0 while True: #print(x,y,ANS) # (x,y)から # (x^1,y+a)へ tox=x^1 toy=y+a k=toy//1000 sa=k-y//1000 if toy%1000==0: if (x==0 and 0<=y<1000) or (x==1 and 1000