import math def main(): x = int(input()) y = int(input()) l = int(input()) ans = abs(math.ceil(x / l)) + abs(math.ceil(y / l)) if y < 0: ans += 2 elif x != 0: ans += 1 print(ans) if __name__ == '__main__': main()