calc_accumulated_trees function

Calculates number of trees until reaching a maximum number of trees