X=int(raw_input()) Y=int(raw_input()) L=int(raw_input()) if Y<0: r=2 elif X==0: r=0 else: r=1 X=abs(X) Y=abs(Y) x=X/L if X%L==0 else X/L+1 y=Y/L if Y%L==0 else Y/L+1 print x+y+r