import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int x = Math.abs(sc.nextInt()); int y = sc.nextInt(); int k = sc.nextInt(); int ans = 0; if (y < 0) { ans++; y = -y; } ans += (y + k - 1) / k; if (x != 0) { ans++; } ans += (x + k - 1) / k; System.out.println(ans); } }