X = int(input()) Y = int(input()) L = int(input()) if X != 0: A = (abs(X)+ L-1)//L else: A = 0 if Y != 0: B = (abs(Y)+L-1)//L else: B = 0 if Y <0: C = 2 elif X == 0 and Y >0: C = 0 elif X != 0 and Y >=0: C = 1 print(A+B+C)