Cosmological density of WIMPs from solar and terrestrial annihilations