import re


def compute_cli(text):
    """Calculate the Coleman-Liau index"""

    # Count letters in text
    n_letters = len(re.findall('[A-Za-z]', text))

    # Count words in text
    n_words = len(re.findall('[ ]', text)) + 1

    # Count sentences in text
    n_sentences = len(re.findall('[.!?]', text))

    # Calculate L average number of letters per 100 words
    l = 100 * n_letters / n_words

    # Calculate S average number of letters per 100 words
    s = 100 * n_sentences / n_words

    # Compute formula
    cli = int(round(0.0588 * l - 0.296 * s - 15.8))

    return cli