Barry's money was $$\frac{1}{2}$$ of Sam's money. If Sam gave $100 to Barry, then Sam's money would become $$\frac{4}{5}$$ of Barrys money. <hr> How much did both of them have altogether at first? <br> <input min="0" type="number" id ="imp6pg066q9_1" class="lineinput" placeholder="?" />