X=int(input()) Y=int(input()) L=int(input()) if 0>Y:O=2 elif X!=0:O=1 else:O=0 print(O+int((abs(X)+L-1)/L)+int((abs(Y)+L-1)/L))