step = 0 x = abs(int(input())) y = int(input()) if y<0: step += 2 y = abs(y) l = abs(int(input())) step += int(x/l) + int(y/l) if x%l>0: step += 1 if y%l>0: step += 1 if x*y>0: step += 1 print(step)