import java.util.*; public class Main { public static void main(String[] args) { // TODO 自動生成されたメソッド・スタブ Scanner sc = new Scanner(System.in); //移動先の東西軸座標 long X = sc.nextLong(); //移動先の南北軸座標 long Y = sc.nextLong(); //最大移動量 long L = sc.nextLong(); //移動回数 int ans = 0; if(X < 0) { X *= -1; } if(Y > 0) { ans += Y / L; if(Y % L != 0) { ans++; } } if(X != 0) { //方向転換 ans++; ans += X / L; if(X % L != 0) { ans++; } } if(Y < 0) { if(X == 0) { ans++; } ans++; Y *= -1; ans += Y / L; if(Y % L != 0) { ans++; } } System.out.println(ans); } }