using System; namespace ConsoleApp11 { class Program { static void Main(string[] args) { ulong count = 0; ulong N = ulong.Parse(Console.ReadLine()); ulong M = ulong.Parse(Console.ReadLine()); if(M * 1000 % N == 0 && N / M >= 1000) { Console.WriteLine(N / M); } else if(M * 1000 % N != 0 && N / M >= 1000) { while (M * 1000 <= N) { N -= M * 1000; count++; } Console.WriteLine(count * 1000); } else if(N / M < 1000) { Console.WriteLine(0); } } } }