import sys
import json

with open(sys.argv[1], 'r') as test_cases:
    for test in test_cases:
        if (test != None):
            sum = 0
            try:
                json_string1 = json.loads(test)
                json_string2 = json_string1["menu"]
                json_list = json_string2["items"]
                for id in json_list:
                    if (id != None and len(id) > 1):
                        sum += int(id["id"])
                print(sum)
            except json.JSONDecodeError:
                print()