Math Problem : C.28 Janken and take marbles

Three persons, A, B, and C played the following game.

When they play a Janken (scissors-paper-rock) and only one person wins, the winner can get same number of marbles as marbles which the winner has from losers, respectively.


The game is over at the time someone's marbles are lost.

At first game A won and at following games, B and C in order won one time respectively. 


As a result, all marbles of A and B were lost. 

The number of the marbles which C finally had was 54. 

Find the number of marbles which A had first. 







Answer
8 pieces