buger = 2000
beverage = 2000

for i in range(3):
    buger_price = int(input())
    buger = min(buger, buger_price)
        
    
for i in range(2):
    beverage_price = int(input())
    beverage = min(beverage, beverage_price)

print(buger + beverage - 50)

total = 0

for i in range(5):
    score = int(input())
    if score < 40:
        score = 40
    total += score

print(int(total/5))

n = int(input())

check = n # 26
count = 0
result = 0
new_num = 0

while True:
    result = n//10 + n%10
    new_num = n%10*10 + result%10
    count += 1
    n = new_num
    if check == n:
        break
print(count)
    
    

while True:
    try:
        A, B = map(int, input().split())
        print(A+B)
    
    except:
        break
    

+ Recent posts