using System;
using static System.Math;

public class Program
{
    public static void Main(string[] args)
    {
        var x = int.Parse(Console.ReadLine());
        var y = int.Parse(Console.ReadLine());
        var step = int.Parse(Console.ReadLine());
        var totalMove = 0;

        if (x != 0) totalMove = 1;
        if (y < 0) totalMove = 2;
        totalMove += (Abs(x) + (step - 1)) / step;
        totalMove += (Abs(y) + (step - 1)) / step;

        Console.WriteLine(totalMove);
    }
}