We consider the infinite-server queueing tandem with the Markovian arrival process. The service time of messages at the first stage and the probability of their transition to the second stage are determined by the type of message that corresponds to the state of the arrival process at the time when the message arrived. A study of this system was performed under an asymptotic condition of high rate of arrivals. A Gaussian approximation is obtained for the joint stationary probability distribution of the number of messages at the stages of the system under the condition. On the basis of this approximation, the problem of computing the optimal number of servers for specific values of model parameters is solved. Further, the obtained asymptotic result is extended to the case when a service at the second stage also depends on the message type, as well as on the case of systems with a number of stages greater than two.