static int lcLength(LineCompedSingle lc) {
int n = 0;
for (int symbol : lc.main)
n += lcLength(lc, symbol);
ret n;
}
static int lcLength(LineCompedSingle lc, int symbol) {
if (symbol < l(lc.literals))
ret 1;
else {
IntPair pair = lc.pairs.get(symbol-l(lc.literals));
ret lcLength(lc, pair.a) + lcLength(lc, pair.b);
}
}