using System; using System.Collections.Generic; using System.Linq; namespace Otoshidama { class Program { static void Main() { var input = new List(); input.Add(Console.ReadLine()); // N input.Add(Console.ReadLine()); // M var nm = input.ConvertAll(str => long.Parse(str)); long n = nm[0]; long m = nm[1]; long res = (n / m / 1000) * 1000; Console.WriteLine(res); } } }