using System;
using System.Collections.Generic;
using System.Linq;

public class Program {
    public static int CalculateMoveCount(int distance, int speed) {
        int r;
        var q = Math.DivRem( Math.Abs(distance), speed, out r );
        return r == 0 ? q : q+1;
    }
    public static int Solver(int x, int y, int l) {
        var nY = CalculateMoveCount( y, l );
        var nX =  CalculateMoveCount( x, l ) ;
        var nRot = y > 0 ? ( x == 0 ? 0 : 1 ) : ( y == 0 ? ( x == 0 ? 0 : 1 ) : 2 );
        return nX + nY + nRot;
    }

    private static void Main() {
        var x = int.Parse( Console.ReadLine() );
        var y = int.Parse( Console.ReadLine() );
        var l = int.Parse( Console.ReadLine() );
        Console.WriteLine( Solver( x, y, l ) );
    }
}