Let's define **subsequence** of the word as part of the word created by deleting some of its letters, for example *aetics* is a subsequence of *mathematics*.

**QUESTION.**

Given a $3$-letter word (let's call it $X$) I want to know how many words consisting of exactly $k_A$ letters $a$, $k_B$ letters $b$, ..., $k_Z$ letters $z$ are there such that $X$ is subsequence of it?

For example, if $k_A = 1, k_B = 1, k_C = 1, k_D = 1, k_E = 0, ..., k_z = 0$, and $X = abc$, then there are $4$ such words.