x = int(input()) y = int(input()) l = int(input()) count = 0 if x != 0: count += (abs(x) + l - 1) // l if y != 0: count += (abs(y) + l - 1) // l if (x != 0) and ('-' in str(y) ): count += 2 elif x != 0: count += 1 elif '-' in str(y): count += 2 print(count)