import strutils var x, y, l = parseInt readLine stdin cnt = 0 if y < 0: cnt.inc 2 elif x != 0: inc cnt if x != 0: cnt += x.abs.pred div l + 1 if y != 0: cnt += y.abs.pred div l + 1 echo cnt