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