def main(): EW = int(input()) NS = int(input()) v = int(input()) ans = round(abs(NS)/v) ans = ans + round(abs(EW)/v) if not( EW%v == 0):ans += 1 if not( NS%v == 0):ans += 1 if not(EW == 0) :ans += 1 if NS < 0 and EW == 0: ans +=2 elif NS < 0: ans +=1 print(ans) if __name__=="__main__": main()