def solution(price, money, count): answer = 0 first = price for i in range(0, count): money -= price price += first if money >= 0: return 0 else: return money*-1