The ratio of the number of cats to the number of dogs in an animal shelter was 2:3. After 120 cats were adopted, the ratio of the number of cats to the number of dogs became 3:7. Find the total number of cats and dogs in the animal shelter in the end?