W = float(input()) D = float(input()) while D > 1: W -= W // (D * D) D -= 1 print(int(W))