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 count = 0; if (y < 0)//y==- { if (x < 0) { count++; x *= -1; count = Kxy(count, x, l); count++; y *= -1; count = Kxy(count, y, l); } else { count = Kxy(count, x, l); count++; y *= -1; count = Kxy(count, y, l); } if (y == 0) { Console.WriteLine(count); } } else//y==+ { count = Kxy(count, y, l); if (x == 0) { Console.WriteLine(count); } if (x < 0)//x - { count++; x *= -1; count= Kxy(count, x, l); Console.WriteLine(count); } else if (x > 0) { count = Kxy(count, x, l); Console.WriteLine(count); } } static int Kxy(int count,int x,int l) { count += x / l; if (x % l != 0) { count += x % l; } return count; } } } }