The ratio of the number of dolls Jacky had to the number of dolls Peter had was 5:2 but, after Jacky gave 15 dolls to Peter, they have an equal number of dolls. How many dolls did they have altogether?​