The three-soliton solutions to the sine-Gordon equation describing the collision of a kink with a breather or with a kink-antikink pair are given and several separatrix three-soliton solutions are extracted from these solutions. The influence of a small perturbation on the three-soliton collisions is studied numerically. As the perturbed system the Frenkel-Kontorova model with a small degree of discreteness is considered. We show that in the three-soliton collisions, in the presence of small perturbation, energy exchange between solitons can take place. The degree of inelasticity of a three-soliton collision is extremely sensitive to the parameters of the collision.