X = int(input()) Y = int(input()) L = int(input()) if X == 0 and Y == 0: print(0) elif X == 0 and Y > 0: N = -(-Y//L) print(N) elif X > 0 and Y == 0: N = -(-X//L) + 1 print(N) elif X == 0 and Y < 0: N = -(-abs(Y)//L) + 2 print(N) elif X < 0 and Y == 0: N = -(-abs(X)//L) + 1 print(N) elif X > 0 and Y > 0: N = -(-X//L) - (-Y//L) + 1 print(N) elif X < 0 and Y > 0: N = -(-abs(X)//L) - (-Y//L) + 1 print(N) elif X < 0 and Y < 0: N = -(-abs(X)//L) - (-abs(Y)//L) + 2 print(N) elif X > 0 and Y < 0: N = -(-X//L) - (-abs(Y)//L) + 2 print(N)