import math a=int(input()) b=int(input()) c=int(input()) d=0 if b<0: d+=2 d+=math.ceil(-b/c) else: d+=math.ceil(b/c) if a<0: d+=1 d+=math.ceil(-a/c) elif a==0: d+=0 else: d+=1 d+=math.ceil(a/c) print(d)