def removeFreeItems(itemCounts):
    itemFreebies = getItemFreebies()
    freeItems = {}
    for (item, count) in itemCounts.items():
        freebies = itemFreebies.get(item, {})
        for (itemsNeededForFreebe, freeItem) in freebies.items():
            freebeeCount = int((count / itemsNeededForFreebe))
            freeItems[freeItem] = freebeeCount
    for (freeItem, count) in freeItems.items():
        itemCounts[freeItem] = max(0, (itemCounts[freeItem] - count))
def removeFreeItems(itemCounts):
    itemFreebies = getItemFreebies()
    freeItems = {}
    for (item, count) in itemCounts.items():
        freebies = itemFreebies.get(item, {})
        for (itemsNeededForFreebe, freeItem) in freebies.items():
            freebeeCount = int((count / itemsNeededForFreebe))
            freeItems[freeItem] = freebeeCount
    for (freeItem, count) in freeItems.items():
        itemCounts[freeItem] = max(0, (itemCounts[freeItem] - count))