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

Задача 39398. GROMOZEKA


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. The code words of the first letters of the alphabet are known: A - 00, B - 01. What is the smallest length of the GROMOZEKA subsequence code?