If a closed oriented surface is cut along a curve into two isometric surfaces with boundary, their Euler characteristics and total Gaussian curvatures agree. Applying Gauss-Bonnet to both halves, whose induced boundary orientations are opposite, gives
Codex Wiki