id go for no more than 20-30 and add them a few at a time
40 fish are going to produce a lot of waste (more as they grow)
as stated it depends on how good the filter and pump are its best to add too few than too many
you can see how the filtration system copes and add more fish but as soon as the filter starts to struggle ,take a couple, out
its nothing to do with depth but surface area the bigger the surface the more fish you can add ,koi will need at least 3ft but id set that as an ideal depth anyway
you could go for commons and comets with a few other fish types mixed in but certainly not more than a dozen koi as these reach 30" in length