That is done by trial and error. Sorry but reality. The tank will support more in the beginning due to exceess matter,but eventually you will have some die off. I have a 40 as well and have a clean up crew consisting of 4 red legged hermits, 2 blue, 4 turbo snails,1 emerald crab and a coral...