def getMoneySpent(keyboards, drives, b):
     buy = -1
    
    for k in keyboards:
        if k < b:
            for d in drives:
                if k + d <= b:
                    buy = max(buy, k + d)
                
    return buy
    def countingValleys(steps, path):
    # Write your code here
    result = 0
    check = 0
    
    for p in path:
        if p == 'U':
            if check + 1 == 0:
                result += 1
            check += 1
        else:
            check -= 1   
    
    return result
def pageCount(n, p):
    return min(p // 2, n//2 - p//2)

 

def sockMerchant(n, ar):
    # Write your code here
    d = dict()
    
    for s in ar:
        if d.get(s) is None:
            d[s] = 1
        else:
            d[s] += 1
        
    cnt = 0
    for _, v in d.items():
        cnt += v // 2
            
    return cnt

 

def bonAppetit(bill, k, b):
    # Write your code here
    actual = (sum(bill) - bill[k]) // 2
    
    result = b - actual
    
    if result > 0:
        print(result)
    else:
        print('Bon Appetit')