# -*- coding: utf-8 -*- import math X = input() Y = input() L = input() Xt = math.ceil(abs(float(X)/float(L))) Yt = math.cecil(abs(float(Y)/float(L))) if X == Y == 0: ans = 0 elif Y == 0 and X != 0: ans = 1 + Xt elif X == 0 and Y != 0: if Y > 0: ans = Yt elif Y < 0: ans = 2 + Yt elif X != 0 and Y > 0: ans = 1 + Xt + Yt elif X != 0 and Y < 0: ans = 2 + Xt + Yt print int(ans)