import java.util.Scanner; public class No0048 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int X = sc.nextInt(); int Y = sc.nextInt(); int L = sc.nextInt(); System.out.println(turnCount(X, Y) + aheadCount(X, Y, L)); } static int turnCount(int x, int y) { if (y > 0) { if (x == 0) { return 0; } return 1; } else { return 2; } } static int aheadCount(int x, int y, int l) { int cnt = (Math.abs(x) / l) + (Math.abs(y) / l); if (x % l != 0) { cnt++; } if (y % l != 0) { cnt++; } return cnt; } }