if i have any number N how can i know who win if two players play optimally.

here is the problem statment :

There is a game played by two players called “One Two”. The first player starts the game and choose either 1 or 2 then the second player chooses to add 1 or 2 to the number the first player chose. then the first player choose to add 1 or 2 to the resulting value from the previous two turns and so on. The player that reaches N first wins.

For example if N = 5 and the first player chooses 2 (Sum so far = 2) then the second player

chooses 1 (Sum so far = 3) then the first player chooses 2 (Sum so far = 5) then the first player

wins this game as he is the one who reached 5.

so if i have any number N how can i know who win if two players play optimally???!!!