P10518 [XJTUPC 2024] Jiaoxiaoxi’s Gift

Background

Xiaoxi has prepared exquisite gifts for everyone participating in this contest! ![](https://cdn.luogu.com.cn/upload/image_hosting/qjzqxmt1.png)

Description

Xiaoxi plans to give exactly one prize to **each person** among $a$ volunteers, $b$ solo teams, $c$ two-person teams, and $d$ three-person teams. She wants to know how many prizes in total need to be handed out.

Input Format

The input consists of one line with four integers $a,b,c,d$ ($0 \leq a, b, c, d \leq 200$), with the meanings described above.

Output Format

Output one line containing one integer, representing the total number of prizes to be handed out.

Explanation/Hint

The smart, beautiful, and kind Jiaoxiaoxi wants to improve everyone’s contest experience, and she reminds you: Problems A, B, and C are all easy problems, and **the later problems are not guaranteed to have increasing difficulty**. If you get stuck on some problem, you may want to check what problems other teams on the leaderboard are working on. Generally, problems with more accepted submissions tend to be easier. Translated by ChatGPT 5