from math import ceil x=int(input()) y=int(input()) l=int(input()) ans=0 if x<0: x*=-1 ans+=1 if y<0: y*=-1 ans+=2 ans+=ceil(x/l) ans+=ceil(y/l) print(ans)