Hunter had 1/9 as many hats as Riley. Riley gave 32 hats to Hunter so that they would each have the same amount. How many hats did the two friends have altogether?

hunter has x hats

Riley has 9x hats

After charity event:
Hunter has x+32 hats
Riley has 9x - 32 hats

they have the same number -----> 9x - 32 = x + 32
8x = 64
x = 8

make sense of my solution.