X = int(input()) Y = int(input()) L = int(input()) Destination = list([X,Y]) def PositonJudge(Destination,L): cnt = 0 Syo = 0 Amari = 0 if Destination[0] < 0 and Destination[1] < 0: cnt += 2 elif (Destination[0] != 0) or (Destination[1] < 0): cnt += 1 if Destination[0] < 0: Destination[0] *= -1 if Destination[1] < 0: Destination[1] *= -1 for i in range(2): Syo = Destination[i] // L Amari = Destination[i] % L if Amari > 0: cnt += 1 cnt += Syo print(cnt) PositonJudge(Destination,L)