We consider the machine repair problem in which failed machines balk (do not enter) with a constant probability (1 – b) and renege (leave the queue after entering) according to a negative exponential distribution. A group of identical automatic machines are maintained by R servers which themselves are subject to breakdowns. Failure and service times of the machines, and breakdown and repair times of the servers, are assumed to follow a negative exponential distribution. Each server is subject to breakdown even if no failed machines are in the system. This paper presents a matrix geometric method for deriving the steady-state probabilities, using which various system performance measures that can be obtained. A cost model is developed to determine the optimum number of servers. The minimum expected cost, the optimal number of servers, and various system performance measures are provided based on assumed numerical values given to the system parameters. Also the sensitivity analysis is investigated.