import java.util.*; public class Yukicoder_48{ public static void main(String[] args){ Scanner stdIn = new Scanner(System.in); int X = stdIn.nextInt(); int Y = stdIn.nextInt(); int L = stdIn.nextInt(); int count = 0; if(X==0 && Y==0){ System.out.println("0"); } else{ if(X>0){ count++; int x = X/L; count += x; X = X - x*L; if(X!=0){ count++; } X++; } else if(X<0){ count++; X = (-1)*X; int x = X/L; count += x; X = X - x*L; if(X!=0){ count++; } X++; } if(Y>0){ int y = Y/L; count += y; Y = Y - y*L; if(Y!=0){ count++; } } else if(Y<0){ if(X==0){ count++; } count++; Y = (-1)*Y; int y = Y/L; count += y; Y = Y - y*L; if(Y!=0){ count++; } } System.out.println(count); } } }