using System; using System.Collections.Generic; using System.Linq; namespace Test { class Program { static void Main(string[] args) { long w = long.Parse(Console.ReadLine()); long d = long.Parse(Console.ReadLine()); for (; d > 1; d--) { w -= w / (d * d); } Console.WriteLine(w); } } }