import java.util.*; import java.util.stream.*; import static java.lang.Math.*; public class Main{ public static void main(String... args){ Scanner sc=new Scanner(System.in); int x=sc.nextInt(); int y=sc.nextInt(); int l=sc.nextInt(); int ans=0; if(x==0){ if(y==0){ put(0); return; }else if(y>0){ }else{ ans+=2; } }else if(x>0){ if(y==0){ ans+=1; }else if(y>0){ ans+=1; }else{ ans+=2; } }else{ if(y==0){ ans+=1; }else if(y>0){ ans+=1; }else{ ans+=2; } } ans+=x%l==0?abs(x/l):abs(x/l)+1; ans+=y%l==0?abs(y/l):abs(y/l)+1; put(ans); } public static void print(Object object){ System.out.print(object); } public static void put(Object object) { System.out.println(object); } public static void put(){ System.out.println(); } public static void print(String format,Object... args){ System.out.print(String.format(format,args)); } public static void put(String format,Object... args) { System.out.println(String.format(format,args)); } }