In a class of 40 students, everyone has either a pierced nose or a pierced ear. The professor asks everyone with a pierced nose
to raise his or her hand. Eight hands go up. Then the professor asked everyone with a pierced ear to do likewise. This time there are 34 hands raised. How many students have piercings both on their ears and their noses?