from math import ceil X = int(input()) Y = int(input()) L = int(input()) if Y >= 0: if X!=0 and Y!=0: print(abs(ceil(X/L)) + abs(ceil(Y/L)) + 1) else: print(abs(ceil(X/L)) + abs(ceil(Y/L))) else: if X!=0 and Y!=0: print(abs(ceil(X/L)) + abs(ceil(Y/L)) + 3) else: print(abs(ceil(X/L)) + abs(ceil(Y/L)) + 2)