# import math

# with open("inputt.txt", 'r') as f:
#     fish = list(map(int, f.read().strip().split(',')))

#     # fish = [[e, [e]] for e in fish]

#     # for e in fish:
#     #     print(e)
#     #     for i in range(256):
#     #         fish_new = []

#     #         for g in e[1]:
#     #             if g == 0:
#     #                 fish_new.append(8)
#     #                 fish_new.append(6)
#     #             else:
#     #                 fish_new.append(g - 1)

#     #         e[1] = fish_new

#     # print(sum(len(e[1]) for e in fish))

#     # print(fish)

#     # sum = 0

#     # for e in fish:
#     #     print(2**((e[1] - e[0])/6))
#     #     sum += 2**((e[1] - e[0])/6)
#     #     # print([8, 0] * math.floor(2**((e[1] - e[0])/6)))
#     #     # fish + [8, 0] * math.floor(2**((e[1] - e[0])/6))

#     # print(math.floor(sum))

#     for i in range(256):
#         print(i)
#         fish_new = []

#         for e in fish:
#             if e == 0:
#                 fish_new.append(8)
#                 fish_new.append(6)
#             else:
#                 fish_new.append(e - 1)

#         fish = fish_new

#     # for e in fish:
#     #     e[1].append(e[0])

#     #     print(e)
#     #     for g in e[1]:
#     #         print(f"    {g}")
#     #         fish_new = []

#     #         for i in range(256):
#     #             if g == 0:
#     #                 fish_new.append(8)
#     #                 fish_new.append(6)
#     #             else:
#     #                 fish_new.append(g - 1)

#     #         e[1] = fish_new

#     # print(sum(len(e[1]) for e in fish))

#     print(len(fish))

# days = 256
# f = open("input.txt", "r")
# lines = f.readlines()

# fishpopulation = []
# for i in range(9):
#     fishpopulation.append(lines[0].count(str(i)))

# i = 0
# print(fishpopulation)
# while i < days:
#     newpop = [0, 0, 0, 0, 0, 0, 0, 0, 0]
#     day = 1
#     while day < len(fishpopulation):
#         #shift everything left
#         newpop[day - 1] = fishpopulation[day]
#         day += 1
#     #put the new fish at the back
#     newpop[8] = fishpopulation[0]
#     #put the mother fish at 7 days away
#     newpop[6] += fishpopulation[0]
#     fishpopulation = newpop
#     i += 1
# print(fishpopulation)
# print(sum(fishpopulation))