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 if 0<=y<1000 and x==0: if toy%2000==0: k=toy//1000 ANS+=(k-2)*2+2 elif 0