How do you work out and exercise and not lose weight?

I would like to get into an exercise and workout routine but I am already very thin and don’t need to lose weight. If anything, I’d like to gain some. How do you find out the optimium caloric for what is spent working out and exercising so that you will not lose weight – but gain it?
Saucy – that’s a good answer so far. How do you calculate how many calories you burn a day just by being yourself?
Several people did not read the question. I DO NOT want to lose weight.