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