Surgery and Topological Invariants of Punctured Riemann Surfaces