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 a; int b; int count = 0; int ans=0; if (y ==0) { if (x != 0) { count = 1; } }else if (x == 0) { if (y < 0) { count = 2; } } else { if (y > 0) { count = 1; } else { count = 2; } } if (x < 0) { x *= -1; } if (y < 0) { y *= -1; } ans += x / l; ans += x % l; ans += y / l; ans += y % l; ans += count; Console.WriteLine(ans); } } }