One of the patients' basic needs when referring to the hospital is to access doctors as soon as possible at a low cost. In this regard, many hospital managers aim to improve healthcare quality.They strive to plan and perform better patient flow in different parts of hospitals. With the widespread of Covid-19, the importance of this matter has become more apparent. Queueing systems are one of the methods that help recognize delays and help to identify bottlenecks. This paper has extended a queue theory model to measure the number of servers in each part of the hospital. The model aims to reduce the hospital's expected total cost, including the waiting time cost of the patients in queues, idle server cost, operating, and the marginal cost of the servers, in a covid-19 pandemic. The proposed model has been solved with Grasshopper Optimization Algorithm (GOA) for large-scale data. Then sensitivity analysis is presented to understand the model better and identify effective parameters.