When a protein folds or unfolds, it has to pass through many half-folded microstates. Only a few of them can be seen experimentally. In a two-state transition proceeding with no accumulation of metastable intermediates [Fersht, A. R. (1995) Curr. Opin. Struct. Biol. 5, 79-84], only the semifolded microstates corresponding to the transition state can be outlined; they influence the folding/unfolding kinetics. Our aim is to calculate them, provided the three-dimensional protein structure is given. The presented approach follows from the capillarity theory of protein folding and unfolding [Wolynes, P. G. (1997) Proc. Natl. Acad. Sci. USA 94, 6170-6175]. The approach is based on a search for free-energy saddle point(s) on a network of protein unfolding pathways. Under some approximations, this search is rapidly performed by dynamic programming and, despite its relative simplicity, gives a good correlation with experiment. The computed folding nuclei look like ensembles of those compact and closely packed parts of the three-dimensional native folds that contain a small number of disordered protruding loops. Their estimated free energy is consistent with the rapid (within seconds) folding and unfolding of small proteins at the point of thermodynamic equilibrium between the native fold and the coil.