import gzip


def naive_count_lines(infile):
    """ Count lines in a gzip JSON LD file """
    n = 0

    with gzip.open(infile, 'r') as source:
        for _, n in enumerate(source, 1):
            pass

    return n