It depends on the type of foam also. There are 2 kinds, open cell, basically a sponge, & closed cell.
Closed cell will not absorb moisture as each individual bubble is sealed.
Allan Quartermain: “Automatic rifles. Who in God's name has automatic rifles”?
Elderly Hunter: “That's dashed unsporting. Probably Belgium.”