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