Epidemic models are a valuable tool in the decision-making process. Once a mathematical model for an epidemic has been established, the very next step is calculating a mathematical expression for the basic reproductive number, R0, which is the average number of infections caused by an individual that is introduced in a population of susceptible. Finding a mathematical expression for R0 is important because it allows to analyze the effect of the different parameters in the model on R0, so that we can act on some of them, in an attempt to keep R0 < 1 to avoid a large epidemic. In this work we show how to calculate R0 in complex epidemic models by using only basic concepts of Markov chains. We compare our approach with the traditional methods used in epidemiology and demography.