import sys read=sys.stdin.buffer.read X,Y,L=map(int,read().split()) ANS=(abs(X)+L-1)//L+(abs(Y)+L-1)//L if Y<0:ANS+=2 elif X!=0:ANS+=1 print(ANS)