import java.util.Scanner; public class Main_yukicoder48 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int x = sc.nextInt(); int y = sc.nextInt(); int l = sc.nextInt(); int ret = 0; if (x == 0 && y == 0) { } else if (x == 0 && y > 0) { ret = (y + l - 1) / l; } else if (x == 0 && y < 0) { ret = 2; ret += (Math.abs(y) + l - 1) / l; } else if (x != 0 && y == 0) { ret = 1; ret += (Math.abs(x) + l - 1) / l; } else if (x != 0 && y > 0) { ret = 1; ret += (Math.abs(y) + l - 1) / l; ret += (Math.abs(x) + l - 1) / l; } else { ret = 2; ret += (Math.abs(y) + l - 1) / l; ret += (Math.abs(x) + l - 1) / l; } System.out.println(ret); sc.close(); } }