If the foam is wet, you don't want to leave it, it adds a lot of weight to the boat, and if you are replacing the floor, your foam is wet, which will again cause problems in the future, you don't want to do all this work and then have to do it over in a couple of years. Also the stringer need to be checked and repaired as problems are found, and you need to check the transom, cause if the water got in to damage the floor and the stringers, you can bet it got into the transom and is going to cause problems.
Once wet, that foam will never dry, it becomes a liability and won't do what it is suppose to do in the event there is a breach in the hull. Once you get everything re-done, foam is actually quite easy to do, and don't think you can do it with expanding insulation foam, don't work so good, not dense enough and will breakdown after a while.
Do it right the first time and you should not have to do it again. In order to figure how much to buy, you need to calculated the cubic volume under the floor. Just do a search for Boat Flotation Foam and you will find lots of places selling it and I am sure there are many here that will give you recommendations as to where to get it.