X = abs(int(input())) Y = int(input()) L = int(input()) C = (X//L)+(Y//L) if X%L == 1:C+=1 if Y%L == 1:C+=1 if X>0 and Y>0:C += 1 elif X>0 and Y<0:C += 2 elif Y==0 and X>0:C += 1 print(C)