class PartialMerkleTreeFormatUtils {

    public static VarInt getFlagBitsCount(byte[] pmtSerialized) {
        VarInt hashesCount = getHashesCount(pmtSerialized);
        return new VarInt(
                pmtSerialized,
                Math.addExact(
                    BLOCK_TRANSACTION_COUNT_LENGTH + hashesCount.getOriginalSizeInBytes(),
                    Math.multiplyExact(Math.toIntExact(hashesCount.value), Sha256Hash.LENGTH)
                )
        );
    }

}