The permutation $\sigma$ consisting of four words $A,B,C,D$ has $f_{AB}(\sigma)$, the sum of the number of $B$ placed rightside of every $A$. We can define $f_{BC}(\sigma)$,$f_{CD}(\sigma)$,$f_{DA}(\sigma)$ as the same way too. For example, $\sigma=ACBDBACDCBAD$, $f_{AB}(\sigma)=3+1+0=4$, $f_{BC}(\sigma)=4$,$f_{CD}(\sigma)=6$, $f_{DA}(\sigma)=3$ Find the maximal value of $f_{AB}(\sigma)+f_{BC}(\sigma)+f_{CD}(\sigma)+f_{DA}(\sigma)$, when $\sigma$ consists of $2020$ letters for each $A,B,C,D$