X,Y,L = input(),input(),input() count = 0 if (X < 0 or X > 0) and Y < 0:count+=2 elif (X < 0 or X > 0) and Y > 0:count+=1 elif(X == 0) and Y < 0:count += 2 elif Y == 0 and (X < 0 or X > 0):count += 1 X,Y = abs(X),abs(Y) count += int(X / L) if X % L > 0:count += 1 count += int(Y / L) if Y % L > 0:count += 1 print count