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