# your code goes here x=STDIN.gets.to_i y=STDIN.gets.to_i L=STDIN.gets.to_i ans=0 r=0 if x!=0 r=1 end if y<0 r=2 end ans=x.abs/L+y.abs/L+r if x.abs%L>0 ans+=1 end if y.abs%L>0 ans+=1 end puts ans