import java.util.Scanner; public class No00000048_Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int x = scan.nextInt(); int y = scan.nextInt(); int l = scan.nextInt(); int cnt = 0; if(x != 0 || y != 0) { if(y >= 0) { if(x != 0) { cnt += 1; } } else { cnt += 2; } cnt += (Math.abs(x) / l) + (Math.abs(x) % l == 0 ? 0 : 1); cnt += (Math.abs(y) / l) + (Math.abs(y) % l == 0 ? 0 : 1); } System.out.println(cnt); scan.close(); } }