import java.util.*; import java.math.*; import java.io.*; public class Main { 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 ans = 0; if(y >= 0 && x != 0) ans += 1; else if(y < 0 || x != 0) ans += 2; ans += Math.abs((y / l)) + (y % l != 0 && y != 0?1:0); ans += Math.abs((x / l)) + (x % l != 0 && x != 0?1:0); System.out.println(ans); } }