import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; class No48 { public static void main(String[] args) throws IOException, NumberFormatException{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int touzai = Integer.parseInt(br.readLine()); int nanboku = Integer.parseInt(br.readLine()); int zenshin = Integer.parseInt(br.readLine()); int x = Calculation.calc(touzai,zenshin); int y = Calculation.calc(nanboku,zenshin); System.out.println( x + y + Calculation.direction(touzai,nanboku)); } public static class Calculation{ public static int calc(int x, int y){ if (Math.abs(x)%y == 0) return (Math.abs(x)/y); //Math.abs(x)はxの絶対値 else return (Math.abs(x)/y) + 1; } public static int direction(int x, int y){ if (x != 0 && y < 0 ) return 2; if (x != 0 && 0 <= y) return 1; if (x == 0 && y <0) return 2; else return 0; } } }