Answer:
Of the 870 boys, (2/3)(870) = 580 study Spanish.
Of the 800 girls, (3/5)(800) = 480 study Spanish.
So 1,060 of the 1,670 students study Spanish, meaning 1,670 - 1,060 = 610 of the 1,670 students do not study Spanish.
The probability that a student chosen at random from the whole school does not study Spanish is 610/1,670 = 61/167.