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