import java.util.Scanner; public class Main { public static void main(String[] a) { Scanner s=new Scanner(System.in); int X=s.nextInt(),Y=s.nextInt(),L=s.nextInt(); int H=(int)Math.ceil(Math.abs((double)X/L)),V=(int)Math.ceil(Math.abs((double)Y/L)); int P=(int)(Math.signum(X)+1+3*(Math.signum(Y)+1)); System.out.println(H+V+(new int[]{2,2,2,1,0,1,1,0,1})[P]); } }