import java.io.*; import java.util.*; import java.math.*; class Main48 { public static void out (Object out) { System.out.println(out); } public static void main (String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int x = Integer.parseInt(br.readLine()); int y = Integer.parseInt(br.readLine()); int l = Integer.parseInt(br.readLine()); int turnCnt = y < 0 ? 2 : x == 0 ? 0 : 1; x = Math.abs(x); y = Math.abs(y); int move1 = (double)x / l == x / l ? x / l : x / l + 1; int move2 = (double)y / l == y / l ? y / l : y / l + 1; out(move1 + move2 + turnCnt); } }