1/2 of Pete's class brought in valentines. 3/4 of the kids who brought in valentines also brought on candy. If there are 24 students in Pete's class, how many students brought in valentines and candy?