Cardinal of a set of functions between two finite sets of integers 
Let $ A= \{a_1, a_2, a_3,\cdots, a_{10}\}$, $B=\{ 1,2 \}$. Find the number of functions $ f: A \to B $ such that $ f(a_1) +f(a_2)+\cdots+f(a_{10})$ is an even number.

I have tried to find the number of functions $ 2^{10} $ But not getting any clue to find the functions under such conditions.

Hint
Intuitively, the number of such maps is $2^{10}/2$: there is the same number of maps such that the sum is even, vs. the maps for which the sum is odd.
To prove it, prove that there is a one to one correspondence between the maps such that $f(a_1)=1$, vs the ones for which $f(a_1)=2$.
