import java.util.Scanner; public class Exercises13{ public static void main (String[] args){ Scanner sc = new Scanner(System.in); int x = sc.nextInt(); int y = sc.nextInt(); int maxMove = sc.nextInt(); int oderCount = 0; if (y >= 0){ double count = Math.ceil((double)y / (double)maxMove); oderCount += (int)count; // 方向転換 // oderCount += 1; if (x > 0){ oderCount += 1; count = Math.ceil((double)x / (double)maxMove); oderCount += (int)count; }else if (x < 0){ oderCount += 1; count = Math.ceil((double)x / (double)maxMove * -1); oderCount += (int)count; } }else{ oderCount += 1; if (x > 0){ double count = Math.ceil((double)x / (double)maxMove); oderCount += (int)count; }else{ double count = Math.ceil((double)x / (double)maxMove * -1); oderCount += (int)count; } oderCount += 1; double count = Math.ceil((double)y / (double)maxMove * -1); oderCount += (int)count; } System.out.println(oderCount); } }