A cube of side 15 cm is painted red on the pair of one opposite surfaces, green on the pair of another opposite surfaces and one pair of opposite surfaces is left unpainted. Now the cube is divided into 125 smaller cubes of side 3 cm each.How many smaller cubes have three surfaces painted?