David, Malachy and Paul share some sweets in the ratio 5:3:1. David gets 40 more sweets than Paul. How many sweets are there altogether?