X=int(raw_input()) Y=int(raw_input()) L=int(raw_input()) a=(abs(X)+L-1)/L b=(abs(Y)+L-1)/L c=1 if a==0 or b==0: c=0 print a+b+c