There is a game system called a double-lost resurrection game, that is, every two teams compete, the winner enters the winner's bracket, and the loser enters the loser's bracket. If you lose, you will be eliminated, and so on until the champions of the winner group and the loser group enter the final championship and runner-up finals. The final will adopt a three-game two-win system. There are 2012 teams participating in a certain game. Regardless of the draw, how many games will be played at most? In order to produce the final champion. (When there is an odd number of teams in a group in a certain round, draw lots to decide to give a team a bye in this round.)
有一种比赛赛制叫做双败复活赛，即每两队进行比赛，胜者进入胜者组，负者进入败者组，胜者组的每轮负者降入败者组，败者组中再败则被淘汰，如此直至胜者组和败者组的冠军进入最后的冠亚军决赛，决赛采取三局两胜制，某次比赛有2012支队伍参赛，不考虑平局，那么最多要赛多少场才能产生最后的冠军．(某轮次遇到组内队伍数为奇数的时候，抽签决定让一支队伍本轮轮空．)
<gadget id="calculator">2_012 - 2</gadget>
<output>2_010</output>

<gadget id="calculator">2_010 * 2</gadget>
<output>4_020</output>

<gadget id="calculator">4_020 + 1 + 3</gadget>
<output>4_024</output>

<result>4_024</result>