x=int(input()) y=int(input()) l=int(input()) count=0 count+=-(-abs(x)//l) count+=-(-abs(y)//l) if y<0: count+=2 elif x==0: pass else: count+=1 print(count)