I totally agree with both @Ben Crowell and @Jon Custer in their comments to your question. The answers to this a easily searchable and require some very simple maths to work out.
As a quick google search will tell you, sea water contains about 380 mg of potassium per litre of water. A typical daily requirement for a typical sedentary person (i.e. not active in a survival situation) of potassium is 3500-4000 mg per day meaning you would have to drink roughly 10 litres of sea water per day to meet the requirement. This is a massive volume of water to drink and the other salts in the sea water would make you quite sick.
Don't drink the sea water - evaporating the water to get salt and then adding this to your water is a possibility, but again, you will be adding the other salts too.
As for ash, the magnesium content of the ash entirely depends on the type of tree you are burning. It seems that potassium is abut 2.6% of ash, so by simple math you would need to add about 154 g of ash to your drink to get the amount of potassium you need daily.