{"raw_statement":[{"iden":"problem statement","content":"The following game is called Game $n$:\n\n> The game is played by Alice and Bob. Initially, there are $n$ stones.\n> The players alternate turns, making a move described below, with Alice going first. The player who becomes unable to make a move loses.\n> \n> *   In Alice's turn, she must remove a number of stones that is a positive multiple of $A$.\n> *   In Bob's turn, he must remove a number of stones that is a positive multiple of $B$.\n\nIn how many of Game $1$, Game $2$, ..., Game $N$ does Alice win when both players play optimally?"},{"iden":"constraints","content":"*   $1 \\leq N ,A,B \\leq 10^{18}$\n*   All values in input are integers."},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$N$ $A$ $B$"},{"iden":"sample input 1","content":"4 2 1"},{"iden":"sample output 1","content":"2\n\nIn Game $1$, Alice cannot make a move and thus loses.\nIn Game $2$, Alice removes $2$ stones, and then Bob cannot make a move: Alice wins.\nIn Game $3$, Alice removes $2$ stones, Bob removes $1$ stone, and then Alice cannot make a move and loses.\nIn Game $4$, Alice removes $2 \\times 2 = 4$ stones, and then Bob cannot make a move: Alice wins.\nTherefore, Alice wins in two of the four games."},{"iden":"sample input 2","content":"27182818284 59045 23356"},{"iden":"sample output 2","content":"10752495144"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}