X=int(input()) Y=int(input()) L=int(input()) if X%L == 0: if X < 0: X = int(abs(X)/L)+2 else: X = int(abs(X)/L) elif X%L != 0: if X < 0: X = int(abs(X)/L)+3 else: X = int(abs(X)/L)+1 if Y%L == 0: if Y < 0: Y = int(abs(Y)/L)+1 else: Y = int(abs(Y)/L)+1 elif Y%L != 0: if Y < 0: Y = int(abs(Y)/L)+2 else: Y = int(abs(Y)/L)+2 print(X+Y)