The age of the main population of the Sagittarius dwarf spheroidal galaxy. Solving the "M giant conundrum"