from math import ceil, fabs f = lambda : int(input()) x, y, l = f(), f(), f() ans = 0 if y < 0: if x != 0: ans += 1 else: ans += 2 print(ans + ceil(fabs(x)/l) + ceil(fabs(y)/l))