using System; namespace yukicoder { class Program { static void Main(string[] args) { int X = int.Parse(Console.ReadLine()); int Y = int.Parse(Console.ReadLine()); int L = int.Parse(Console.ReadLine()); int i = 0, j = 0; int count , hosuucount = 0; //向き if (Y >= 0 && !(X == 0))//Yが+でxが0以外。 { count = 1; } else if (Y < 0 && !(X == 0) || Y < 0 && X == 0 )//⑴X軸でYが0以下⑵ { count = 2; } else { count = 0; } //歩数 if (X > 0) { if (!(X % L == 0)) { hosuucount += X / L + 1; } else { hosuucount += X / L; } } else if (X < 0) { X = X * -1; if (!(X % L == 0)) { hosuucount += X / L + 1; } else { hosuucount += X / L; } } else { hosuucount += 0; } if (Y > 0) { if (!(Y % L == 0)) { hosuucount += (Y / L) + 1; } else { hosuucount += Y / L; } } else if (Y < 0) { Y = Y * -1; if (!(Y % L == 0)) { hosuucount += (Y / L) + 1; } else { hosuucount += Y / L; } } else { hosuucount += 0; } Console.WriteLine(count + hosuucount); } } }