import java.util.*; class Main { private static final String SPLIT_STR = " "; public static void main(String[] args) { // Scanner生成 Scanner sc = new Scanner(System.in); // 入力設定 String input = sc.nextLine(); int X = Integer.parseInt(input); sc.reset(); input = sc.nextLine(); int Y = Integer.parseInt(input); sc.reset(); input = sc.nextLine(); int L = Integer.parseInt(input); // Scannerクローズ sc.close(); /* メイン処理開始 */ // 変数初期化 int result = 0; int turnCnt = 0; // 結果設定 if (X != 0) { turnCnt++; } if (X == 0 && Y < 0) { turnCnt++; } if (X < 0) { X *= -1; } if (Y < 0) { Y *= -1; turnCnt++; } result = (int)Math.ceil((double)X / L) + (int)Math.ceil((double)Y / L) + turnCnt; /* メイン処理終了 */ // 結果出力 System.out.println(result); } }