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