It seems the answer is much more simpler than I thought.
I tried to put all the formula into an equation, and got stuck with "e1.count = e1.count + 1"; and "e2.count = e2.count + e1.count;" which then I got lost where to put e1=e2 in the middle.
Thanks for shedding the light.
The answer is: e1.count = e1.count * 2 + 2
And thanks for the input Fred, it's great, it gives me clearer picture......and I'll save log4j later...as your suggestion.