using System;
public class Program
{
    static void Main()
    {
        int x = int.Parse(Console.ReadLine());
        int y = int.Parse(Console.ReadLine());
        int l = int.Parse(Console.ReadLine());
        int c = 0;
        if (y >= 0)
        {
            c += (y + l - 1) / l;
            if (x != 0)
            {
                c += 1 + (Math.Abs(x) + l - 1) / l;
            }
        }
        else
        {
            c += 2;
            if (x != 0)
            {
                c += (Math.Abs(x) + l - 1) / l;
            }
            c += (-y + l - 1) / l;
        }
        Console.WriteLine(c);
    }
}