# coding: utf-8 x = int(input()) y = int(input()) l = int(input()) def move(mv): cnt = int(abs(mv)/l) if (mv % l != 0): cnt += 1 return cnt ans = 0 if (y > 0): ans += move(y) if(x != 0): ans += move(x) ans += 1 elif (y < 0): ans = move(y) ans += 2 move(x) else: ans += 1 ans += move(x) print(ans)