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