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; if(x%n > 0){ xa += 1; } int ya = y/n; if(y%n > 0){ ya += 1; } System.out.println(count + xa + ya); } }