Chain-Level Formula for the Lefschetz Number