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