import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; public class No48 { public static void main(String[] args) throws IOException { //ロボットの操縦 String[] text = readStr(); Long X = Long.parseLong(text[0]) , Y = Long.parseLong(text[1]) , L = Long.parseLong(text[2]); Long count = Math.floorDiv(Math.abs(X), L) + Math.floorDiv(Math.abs(Y) , L); if(Math.floorMod(Math.abs(X), L) > 0) { count += 1; } if(Math.floorMod(Math.abs(Y), L) > 0) { count += 1; } if(Y >= 0 && X != 0) { count += 1; }else if(Y < 0){ count += 2; } System.out.println(count); } public static String[] readStr() throws IOException{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); ArrayList list = new ArrayList<>(); do { list.add(br.readLine()); }while(br.ready()); br.close(); String[] text = new String[list.size()]; list.toArray(text); return text; } }