Олимпиадный тренинг

Задача 39399. KAMCHATKA - 2


To encode a certain sequence consisting of all capital letters of the Russian alphabet, we decided to use a non-uniform binary code that satisfies the condition that no code word is the beginning of another code word. This condition ensures that encoded messages can be unambiguously decrypted. Known code words  some letters of the alphabet: B - 010, C - 011. What is the smallest length of the KAMCHATKA subsequence code?