Find the value of the following sum of 100 terms. (Possible hint: also consider the same sum with $\sin^{2}$ instead of $\cos^{2}$.)
$$\cos^{2}\left(\frac{\pi}{101}\right) + \cos^{2}\left(\frac{2\pi}{101}\right) + \cos^{2}\left(\frac{3\pi}{101}\right) + \cdots + \cos^{2}\left(\frac{99\pi}{101}\right) + \cos^{2}\left(\frac{100\pi}{101}\right)$$