A triangle has one right angle and a second angle measuring 40 degrees. What is the measure of the third angle? ________ degrees.