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 = Math.abs(Long.parseLong(text[0])) , Y = Math.abs(Long.parseLong(text[1])) , L = Long.parseLong(text[2]); Long count = Math.floorDiv(X, L) + Math.floorDiv(Y , L); if(Math.floorMod(X, L) > 0) { count += 1; } if(Math.floorMod(Y, L) > 0) { count += 1; } if(X != 0 && Y != 0) { count += 1; } 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; } }