import java.util.*; import java.lang.*; import java.io.*; class Main { public static void main (String[] args) { // 入力値の読み込み Scanner sc = new Scanner(System.in); int x = sc.nextInt(); int y = sc.nextInt(); int n = sc.nextInt(); int count=0; if(y < 0){ count = 2; }else{ if(!(x ==0)){ count = 1; } } int xa = x/n; int xb = Math.abs(xa); if(!(x%n == 0)){ xb += 1; } int ya = y/n; int yb = Math.abs(ya); if(!(y%n == 0)){ yb += 1; } System.out.println(count + xb + yb); } }