Please make this a function:
def count_item(filename):