Joe and Mary each pay the same price for a T-shirt. Before they buy it, Mary has $2 more than Joe. To buy the T-shirt, Joe spends $1 less than 2/5 of his money, and Mary spends 1/3 of her money. What was the total amount of money Joe and Mary originally had altogether?