import java.util.*; class Main{ public static void main(String args[]){ Scanner sc = new Scanner(System.in); int X = Integer.parseInt(sc.next()); int Y = Integer.parseInt(sc.next()); int L = Integer.parseInt(sc.next()); int ans = (Math.abs(X)+L-1)/L + (Math.abs(Y)+L-1)/L; if(Y>=0){ if(X!=0){ ans++; } } else{ ans = ans + 2; if(X!=0){ ans++; } } System.out.println(ans); } }