from typing import Counter


def check_password(entry):
    """Check if a password conforms to the policy."""
    pwd = entry.split(':')[-1].strip(' ')
    policy = entry.split(':')[0]
    counts = Counter(pwd)
    letter = policy.split(' ')[-1]
    check = policy.split(' ')[0].split('-')
    if counts[letter] >= int(check[0]) and counts[letter] <= int(check[1]):
        return True
    else:
        return False