From the previous setting, after blazing off 297 initial flames and additional 586 flames in a day due to unusual planetary alignment, Blaze the dragon needed to take rest, cooling down and diminishing his flames by 879. How many flames remained after this resting period?