Let  $B_n$ be the set of all sequences of length $n$, consisting of zeros and ones. For every two sequences  $a,b \in B_n$ (not necessarily different) we define strings  $\varepsilon_0\varepsilon_1\varepsilon_2 \dots \varepsilon_n$ and $\delta_0\delta_1\delta_2 \dots \delta_n$ such that $\varepsilon_0=\delta_0=0$ and $$
 \varepsilon_{i+1}=(\delta_i-a_{i+1})(\delta_i-b_{i+1}), \quad \delta_{i+1}=\delta_i+(-1)^{\delta_i}\varepsilon_{i+1} \quad (0 \leq i \leq n-1). 
$$. Let $w(a,b)=\varepsilon_0+\varepsilon_1+\varepsilon_2+\dots +\varepsilon_n$ . Find  $f(n)=\sum\limits_{a,b \in {B_n}} {w(a,b)} $.
.