Gambling probability problem

#1
A slot machine works on inserting a $1 coin. If the player wins,
the coin is returned with an additional $1 coin, otherwise the original coin is
lost. The probability of winning is 1/2 unless the previous play has resulted
in a win, in which case the probability is p < 1/2. If the cost of maintaining
the machine averages $c per play (with c < 1/3), give conditions on the value
of p that the owner of the machine must arrange in order to make a prot in
the long run.