X = int(input()) Y = int(input()) L = int(input()) counter = 0 if X % L == 0 : counter += abs(X//L) else : counter += abs(X//L)+1 if Y % L == 0 : counter += abs(Y//L) else : counter += abs(Y//L)+1 if X == 0 : if Y < 0 : counter += 2 else : if Y > 0 : counter += 1 elif Y == 0 : counter += 1 else : counter += 2 print(counter)