Amy and Jack have candies in a ratio of 1:3. Together, they have a total of 40 candies. How many candies does Amy have?