X = int(input()) Y = int(input()) L = int(input()) direction = [0] #0北1東2南3西 count = 0 if Y > 0: count += (Y-1) // L + 1 if X != 0: count += 1 count += (abs(X)-1) // L + 1 else: count += 1 if X != 0: count += (abs(X)-1) // L + 1 if Y != 0: count += 1 count += (abs(Y)-1) // L + 1 print(count)