import sys input=lambda:sys.stdin.readline().rstrip() X,Y,L=[int(input()) for i in range(3)] print((abs(X)-1)//L+(abs(Y)-1)//L+4-((X==0)+1)*(Y>=0))