import std.algorithm, std.array, std.range; import std.string, std.conv; import std.math; import std.stdio, std.typecons; void main() { auto w = readln.chomp.to!int; auto d = readln.chomp.to!int; while (d > 1) { w -= w / d ^^2; d -= 1; } writeln(w); }