import java.util.Scanner; public class Main{ public static void main(String[] args) { Scanner scan = new Scanner(System.in); long X = scan.nextLong(); long Y = scan.nextLong(); long L = scan.nextLong(); scan.close(); long ans = 0; if(Y < 0) { ans = 1; Y = - Y; } if(X != 0) { ans += 1; if(X < 0) { X = - X; } } ans += X / L + Y / L; if(X % L > 0) { ans += 1; } if(Y % L > 0) { ans += 1; } System.out.println(ans); } }