import java.util.*; public class Main { static Scanner sc = new Scanner(System.in); public static void main(String[] args) { int x = sc.nextInt(); int y = sc.nextInt(); int leng = sc.nextInt(); int times = (Math.abs(x)+leng-1)/leng + (Math.abs(y)+leng-1)/leng; if (y>0 && x==0) {times += 0;} else if (y>0 && x!=0) {times += 1;} else if (y<0) {times += 2;} System.out.println(times); } }