X,Y,L=map(int,(input(),input(),input())) a=0 if X<0:X=-X if X:a+=1 else:a+=(Y<0) if Y<0:Y=-Y;a+=1 print(a+X//L+(X%L!=0)+Y//L+(Y%L!=0))