X = int(input()) Y = int(input()) L = int(input()) # 初期点 x = 0 y = 0 itr = 0 # Yを合わせるのにかかる回数 if Y != 0 and Y % L != 0: itr += (abs(Y) // L) + 1 elif Y != 0 and Y % L == 0: itr += (abs(Y) // L) # 向きを変える処理の場合分け if Y >= 0 and X != 0: itr += 1 elif Y < 0: itr += 2 # Xを合わせるのにかかる回数 if X != 0 and X % L != 0: itr += (abs(X) // L) + 1 elif X != 0 and X % L == 0: itr += (abs(X) // L) print(itr)