Analysis of a two-phase queueing system with a Markov arrival process and losses