A group of university students wants to get to the top of a mountain to have a picnic there. For that they decided to use a cableway.
A cableway is represented by some cablecars, hanged onto some cable stations by a cable. A cable is scrolled cyclically between the first and the last cable stations (the first of them is located at the bottom of the mountain and the last one is located at the top). As the cable moves, the cablecar attached to it move as well.
The number of cablecars is divisible by three and they are painted three colors: red, green and blue, in such manner that after each red cablecar goes a green one, after each green cablecar goes a blue one and after each blue cablecar goes a red one. Each cablecar can transport no more than two people, the cablecars arrive with the periodicity of one minute (i. e. every minute) and it takes exactly 30 minutes for a cablecar to get to the top.
All students are divided into three groups: _r_ of them like to ascend only in the red cablecars, _g_ of them prefer only the green ones and _b_ of them prefer only the blue ones. A student never gets on a cablecar painted a color that he doesn't like,
The first cablecar to arrive (at the moment of time 0) is painted red. Determine the least time it will take all students to ascend to the mountain top.
## Input
The first line contains three integers _r_, _g_ and _b_ (0 ≤ _r_, _g_, _b_ ≤ 100). It is guaranteed that _r_ + _g_ + _b_ > 0, it means that the group consists of at least one student.
## Output
Print a single number — the minimal time the students need for the whole group to ascend to the top of the mountain.
[samples]
## Note
Let's analyze the first sample.
At the moment of time 0 a red cablecar comes and one student from the _r_ group get on it and ascends to the top at the moment of time 30.
At the moment of time 1 a green cablecar arrives and two students from the _g_ group get on it; they get to the top at the moment of time 31.
At the moment of time 2 comes the blue cablecar and two students from the _b_ group get on it. They ascend to the top at the moment of time 32.
At the moment of time 3 a red cablecar arrives but the only student who is left doesn't like red and the cablecar leaves empty.
At the moment of time 4 a green cablecar arrives and one student from the _g_ group gets on it. He ascends to top at the moment of time 34.
Thus, all the students are on the top, overall the ascension took exactly 34 minutes.
一组大学生希望登上山顶去野餐,为此他们决定乘坐缆车。
缆车系统由若干缆车组成,这些缆车通过缆绳悬挂在若干缆车站上。缆绳在第一个和最后一个缆车站之间循环滚动(第一个位于山脚,最后一个位于山顶)。当缆绳移动时,与其相连的缆车也随之移动。
缆车的数量能被三整除,并且按红、绿、蓝三种颜色循环涂装:每辆红色缆车之后是绿色缆车,每辆绿色缆车之后是蓝色缆车,每辆蓝色缆车之后又是红色缆车。每辆缆车最多可乘坐两人,缆车每隔一分钟到达一次(即每分钟一辆),且一辆缆车到达山顶恰好需要 #cf_span[30] 分钟。
所有学生被分为三组:#cf_span[r] 名学生只愿乘坐红色缆车,#cf_span[g] 名学生只愿乘坐绿色缆车,#cf_span[b] 名学生只愿乘坐蓝色缆车。学生从不登上自己不喜欢颜色的缆车。
第一辆到达的缆车(在时间 #cf_span[0])是红色的。请确定所有学生到达山顶所需的最短时间。
第一行包含三个整数 #cf_span[r], #cf_span[g] 和 #cf_span[b](#cf_span[0 ≤ r, g, b ≤ 100])。保证 #cf_span[r + g + b > 0],即至少有一名学生。
输出一个整数——整个团队到达山顶所需的最短时间。
让我们分析第一个样例。
在时间 #cf_span[0],一辆红色缆车到达,一名 #cf_span[r] 组的学生登上它,并在时间 #cf_span[30] 到达山顶。
在时间 #cf_span[1],一辆绿色缆车到达,两名 #cf_span[g] 组的学生登上它;他们在时间 #cf_span[31] 到达山顶。
在时间 #cf_span[2],一辆蓝色缆车到达,两名 #cf_span[b] 组的学生登上它;他们在时间 #cf_span[32] 到达山顶。
在时间 #cf_span[3],一辆红色缆车到达,但剩下的唯一一名学生不喜欢红色,因此缆车空载离去。
在时间 #cf_span[4],一辆绿色缆车到达,一名 #cf_span[g] 组的学生登上它;他在时间 #cf_span[34] 到达山顶。
因此,所有学生都已到达山顶,整个登顶过程共耗时 #cf_span[34] 分钟。
## Input
第一行包含三个整数 #cf_span[r], #cf_span[g] 和 #cf_span[b](#cf_span[0 ≤ r, g, b ≤ 100])。保证 #cf_span[r + g + b > 0],即至少有一名学生。
## Output
输出一个整数——整个团队到达山顶所需的最短时间。
[samples]
## Note
让我们分析第一个样例。
在时间 #cf_span[0],一辆红色缆车到达,一名 #cf_span[r] 组的学生登上它,并在时间 #cf_span[30] 到达山顶。
在时间 #cf_span[1],一辆绿色缆车到达,两名 #cf_span[g] 组的学生登上它;他们在时间 #cf_span[31] 到达山顶。
在时间 #cf_span[2],一辆蓝色缆车到达,两名 #cf_span[b] 组的学生登上它;他们在时间 #cf_span[32] 到达山顶。
在时间 #cf_span[3],一辆红色缆车到达,但剩下的唯一一名学生不喜欢红色,因此缆车空载离去。
在时间 #cf_span[4],一辆绿色缆车到达,一名 #cf_span[g] 组的学生登上它;他在时间 #cf_span[34] 到达山顶。
因此,所有学生都已到达山顶,整个登顶过程共耗时 #cf_span[34] 分钟。
Let $ r, g, b \in \mathbb{Z}_{\geq 0} $ be the number of students preferring red, green, and blue cablecars respectively, with $ r + g + b > 0 $.
Cablecars arrive every minute, starting at time $ t = 0 $, and follow a repeating color sequence: red, green, blue, red, green, blue, ..., with period 3.
Each cablecar has capacity 2.
A student of preference color $ c \in \{r, g, b\} $ may board only a cablecar of color $ c $.
Each cablecar takes exactly 30 minutes to reach the top; thus, a cablecar departing at time $ t $ arrives at time $ t + 30 $.
Let $ t_{\text{last}} $ be the departure time of the last cablecar that carries at least one student.
The total time required for all students to reach the top is $ t_{\text{last}} + 30 $.
Define the sequence of cablecar colors: for $ t \in \mathbb{Z}_{\geq 0} $, the color at time $ t $ is
$$
\text{color}(t) =
\begin{cases}
\text{red} & \text{if } t \equiv 0 \pmod{3}, \\
\text{green} & \text{if } t \equiv 1 \pmod{3}, \\
\text{blue} & \text{if } t \equiv 2 \pmod{3}.
\end{cases}
$$
Let $ n_c(t) $ be the number of students of color $ c \in \{r, g, b\} $ who have boarded by time $ t $.
We simulate boarding greedily: at each time $ t $, if $ \text{color}(t) = c $ and $ n_c(t) < \text{count}_c $, then as many as possible (up to 2) of the remaining students of color $ c $ board.
Let $ t^* $ be the smallest $ t \in \mathbb{Z}_{\geq 0} $ such that $ n_r(t) = r $, $ n_g(t) = g $, and $ n_b(t) = b $.
Then the minimal time for all students to reach the top is:
$$
\boxed{t^* + 30}
$$