X = int(input()) Y = int(input()) L = int(input()) i = 0 if Y < 0: i += 2 if X != 0: i += 1 if (X<0 and Y>=0) or (X>=0 and Y<0): i += (X//L + Y//L)* -1 else: i += X//L + Y//L if X%L != 0: i+= 1 if Y%L != 0: i+= 1 print(i)