def count_number_of_records(db_filename):
    """Count the number of records in `db_filename`."""
    with open(db_filename, 'rt') as f:
        return len(
            [line for line in f.readlines()
             if line.startswith('record(')]
        )