Zero-Counting Formula for the Euler Class