X = int(input()) Y = int(input()) L = int(input()) def disx(x,L): if abs(x) % L == 0: a = abs(x) // L else: a = (abs(x) // L)+1 return int(a) def disy(y,L): if abs(y) % L == 0: b = abs(y) // L else: b = (abs(y) // L)+1 return int(b) if X > 0 and Y > 0 : print( 1 + disx(X,L)+disy(Y,L)) if X > 0 and Y < 0 : print( 2 + disx(X,L)+disy(Y,L)) if X < 0 and Y > 0: print( 1 +disx(X,L)+disy(Y,L)) if X < 0 and Y < 0: print( 2 +disx(X,L)+disy(Y,L)) if X == 0 : if Y > 0: print(disy(Y,L)) if Y < 0: print(2+disy(Y,L)) if Y == 0: if X != 0 : print( 1 + disx(X,L)) if X == 0 and Y == 0: print(0)