import re


def part1(parser):
    """
    count the number of imputs that complete match rule zero
    """
    rule_count = 0
    for line in parser.inputs:
        match = re.match("^"+parser.rules['0']+"$", line)
        if match:
            rule_count+=1
    return rule_count