Let $\hat{a}$ and $\hat{b}$ be two unit vectors. If the vectors $\vec{c} = \hat{a} + 2\hat{b}$ and $\vec{d} = 5\hat{a} - 4\hat{b}$ are perpendicular to each other, then the angle between $\hat{a}$ and $\hat{b}$ is\\
(1) $\frac{\pi}{6}$\\
(2) $\frac{\pi}{2}$\\
(3) $\frac{\pi}{3}$\\
(4) $\frac{\pi}{4}$