Branched covers of the complex projective line ramified over 0, 1, and infinity (Grothendieck's dessins d'enfant) of fixed genus and degree are effectively enumerated. More precisely, branched covers of a given ramification profile over infinity and given numbers of preimages of 0 and 1 are considered. The generating function for the numbers of such covers is shown to satisfy a partial differential equation (PDE) that determines it uniquely modulo a simple initial condition. Moreover, this generating function satisfies an infinite system of PDE's called the Kadomtsev-Petviashvili (KP) hierarchy. A specification of this generating function for certain values of parameters generates the numbers of dessins of given genus and degree, thus providing a fast algorithm for computing these numbers.