X=int(input()) Y=int(input()) L=int(input()) def xset(x): global X if x == 0: X = 0 elif x%L == 0: X = int(abs(x)/L)+1 elif x%L != 0: X = int(abs(x)/L)+2 return X if Y == 0: xset(X) elif Y > 0: if Y%L == 0: Y = int(abs(Y)/L) xset(X) else: Y = int(abs(Y)/L)+1 xset(X) elif Y < 0: if Y%L == 0: xset(X) Y = int(abs(Y)/L)+1 else: xset(X) Y = int(abs(Y)/L)+2 print(X+Y)