In a certain tournament bracket, a player must be defeated three times to be eliminated. If 512 contestants enter the tournament, what is the greatest number of games that could be played?