total_days = int(input()) food_cost = int(input()) flight_cost = int(input()) hotel_cost = int(input()) A = food_cost * total_days B = 2 * flight_cost C = (total_days - 1) * hotel_cost print(A + B + C)