x = int(input())
l = int(input())
total = 0
arr = []
for i in range(0, x):
    n = int(input())
    arr.append(n)
    total = total+n
print(total)

if((l*8)>=total):
    print("0")

else:
    
    


