# -*- coding:utf-8 -*- if __name__ == '__main__': w, d = map(int, (input(), input())) for i in range(d, 1, -1): w -= int(w / i ** 2) print(w)