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.

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.

Print a single number — the minimal time the students need for the whole group to ascend to the top of the mountain.

NoteLet'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.

r,g,b=map(int,raw_input().split())
t=0
while r>0 or g>0 or b>0:
    if t%3==0:
        r-=2
    elif t%3==1:
        g-=2
    else:
        b-=2
    t += 1
t += 29
print t

import sys
import itertools
import math

def is_empty(nums):
    for i in nums:
        if i > 0:
            return False
    return True

lines = [i.rstrip() for i in sys.stdin.readlines()]
nums = [int(i) for i in lines[0].split(" ")]
c = 0

while (not is_empty(nums)):
    for i in range(len(nums)):
        if (is_empty(nums)):
            break
        nums[i] = nums[i] - 2
        c += 1
print c - 1 + 30

from math import ceil
s=raw_input().split()
r=int(ceil(int(s[0])/2.0))-1
g=int(ceil(int(s[1])/2.0))-1
b=int(ceil(int(s[2])/2.0))-1

print max(r*3,g*3+1,b*3+2)+30

# -*- coding: utf-8 -*-
# @Date    : 2019-01-24 10:09:45
# @Author  : raj lath (oorja.halt@gmail.com)
# @Link    : link
# @Version : 1.0.0

from sys import stdin

max_val=int(10e12)
min_val=int(-10e12)

def read_int()     : return int(stdin.readline())
def read_ints()    : return [int(x) for x in stdin.readline().split()]
def read_str()     : return input()
def read_strs()    : return [x for x in stdin.readline().split()]

r, g, b = map(int, input().split())
t_r = 0 + 3 * ((r - 1) // 2)
t_g = 1 + 3 * ((g - 1) // 2)
t_b = 2 + 3 * ((b - 1) // 2)
print(30 + max(t_r, t_g, t_b))

# To change this template, choose Tools | Templates
# and open the template in the editor.
__author__="yaroslav"
__date__ ="$02.08.2011 18:00:13$"

if __name__ == "__main__":
    inp = raw_input().rsplit(' ')
    red = int(inp[0])
    green = int(inp[1])
    blue = int(inp[2])
    tik = 1
    while red>0 or green>0 or blue>0:
        if (tik+3)%3 == 1 and red>0:
            red -= 2
        if (tik+3)%3 == 2 and green>0:
            green -= 2
        if (tik+3)%3 == 0 and blue>0:
            blue -= 2
        tik += 1

    print (tik-2)+30

t=map(int,raw_input().split())
res=-1
while(any(t)):
	t[(res+1)%3]=max(t[(res+1)%3]-2,0)
	res+=1
print 30+res

r,g,b=list(map(int,input().split()))
#Finding no of required cable cars of each colour
r=r//2+r%2
g=g//2+g%2
b=b//2+b%2
#finding arrival time and adding journey time
r=(r-1)*3+30
g=(g-1)*3+31
b=(b-1)*3+32
print(max(r,b,g))

import math
import re
from fractions import Fraction
from collections import Counter

class Task:
    r, g, b = 0, 0, 0
    answer = 0

    def __init__(self):
        self.r, self.g, self.b = [int(x) for x in input().split()]

    def solve(self):
        r, g, b = self.r, self.g, self.b
        currentColor = 0
        while True:
            r = max(r - 2, 0) if currentColor == 0 else r
            g = max(g - 2, 0) if currentColor == 1 else g
            b = max(b - 2, 0) if currentColor == 2 else b
            if r + g + b > 0:
                self.answer += 1
            else:
                break
            currentColor = (currentColor + 1) % 3
        self.answer += 30

    def printAnswer(self):
        print(self.answer)
        #for line in self.answer:
        #    print(re.sub('[\[\],]', '', str(line)))

task = Task()
task.solve()
task.printAnswer()

print max([0, (n + 1) / 2 * 3 + i + 27][n > 0] for i, n in enumerate(map(int, raw_input().split())))

A = list(map(int, input().split()))
t = 0

while max(A) > 0:
    A[t%3] -= 2
    t += 1

print(t + 29)

r,g,v=map(int,raw_input().split())
mint=0
crnt='r'

while (r+g+v)>0:
    if crnt=='r':
        r-=2
        mint+=1
        if r<=0:
            r=0
           # mint-=1
        crnt='g'
        continue
    if crnt=='g':
        g-=2
        mint+=1
        if g<=0:
            g=0
          #  mint-=1
        crnt='v'
        continue
    if crnt=='v':
        v-=2
        mint+=1
        if v<=0:
            v=0
           # mint-=1
        crnt='r'
        continue
mint+=29
print mint

from math import ceil
a,b,c = map(int,input().split())
x,y,z = ceil(a/2),ceil(b/2),ceil(c/2)
maxi = max(x,y,z)
if maxi == z:
	print(32+3*ceil((c-2)/2))
elif maxi == y:
	print(31+3*ceil((b-2)/2))
elif maxi == x:
	print(30+3*ceil((a-2)/2))

import math
r,g,b = map(int,input().split(" "))
t = 30
r = math.ceil(r/2)
g = math.ceil(g/2)
b = math.ceil(b/2)
max = r
if(b>=r and b>=g):
    max = b
    t = t + 2
elif(g>=r and g>=b):
    max = g
    t = t + 1
print(t + (max-1)*3)

def solve():
    l = map(int, str(raw_input()).split())
    num = max(l)
    lister = [(x-1)/2 for x in l]
    num = max(lister)
    lister.reverse()
    index = 2-lister.index(num)
    print num*3 + index + 30

solve()

n = input().split()
x = int(n[0])
y = int(n[1])
z = int(n[2])
t = 29
while not (x <= 0 and y <=0 and z <=0):
    t += 1
    if t % 3 ==0:
        x -= 2
    elif t % 3 ==1:
        y -= 2
    else:
        z -= 2
print(t)

q=raw_input().split();print 30+max(i+~-int(q[i])/2*3for i in(0,1,2))

import math
r,b,g=map(int,raw_input().split())
time=0
count=1
while max(r,b,g)>0:
    if count==1:
        if r>0:
            r-=2
            time+=1
            count+=1
        else:
            count+=1
            time+=1
    elif count==2:
        if b>0:
            b-=2
            time+=1
            count+=1
        else:
            time+=1
            count+=1
    elif count==3:
        if g>0:
            g-=2
            time+=1
            count=1
        else:
            time+=1
            count=1
print (time+30)-1

arr= list(map(int , input().split()))
count = 0
i=0
while sum(arr)!=0:
    if arr[i]>0:
        d = max(arr[i]-2 , 0)
        arr[i] = d
    count = count+1
    i = i +1
    if i==3:
        i = 0
print(count+29)

col = [int(i) for i in raw_input().split()]
t = 0
while sum(col) > 0:
    if col[0] >= 2: col[0] -= 2
    elif col[0] > 0: col[0] = 0
    x = col.pop(0)
    col.append(x)
    if(sum(col) > 0): t += 1
t += 30
print(t)

r,g,b = input().split()
r = int(r)
g = int(g)
b = int(b)

div_r = (r+1)//2
div_g = (g+1)//2
div_b = (b+1)//2
ans = max(3*div_r + 27, 3*div_g + 28, 3*div_b + 29)
print(int(ans))

p = [ int(x) for x in raw_input().strip().split() ]

res = 0
t = 0
while sum(p) > 0:
    p[t % 3] -= min(2, p[t % 3])
    t += 1
    res += 1

print res + 29

import math

r, g, b = map(int, raw_input().split())
t = 30 + max(3 * (int(math.ceil(float(r) / 2)) - 1), 1 + 3 * (int(math.ceil(float(g) / 2)) - 1), 2 + 3 * (int(math.ceil(float(b) / 2)) - 1))
print t

from itertools import cycle
a = map(int, raw_input().split())
c = 30
for i in cycle([0, 1, 2]):
    a[i] = max(0, a[i] - 2)
    if sum(a) == 0: break
    c += 1
print c

rgb=input().split()
r=int(rgb[0])
g=int(rgb[1])
b=int(rgb[2])
t=29
c=0
while True:
    if r==0 and g==0 and b==0:
        break
    elif r>=0 and c%3==0:
        c+=1
        t+=1
        if r-2<0:
            r=0
        else:
            r-=2
    elif g>=0 and c%3==1:
        c+=1
        t+=1
        if g-2<0:
            g=0
        else:
            g-=2
    elif b>=0 and c%3==2:
        c+=1
        t+=1
        if b-2<0:
            b=0
        else:
            b-=2
print(t)

from math import ceil

X, i, Found, Sum = [ceil(i / 2) for i in map(int, input().split())], 2, False, 0
Max = max(X)
while i >= 0:
    if X[i] == max(X):
        Found = True
    Sum += (Max - 1 if not Found else Max)
    i -= 1
print(Sum + 29)

# UB_CodeForces
# Advice: Keep an eye on your goals
# Location: At home next to a cup of thyme tea
# Caption: I expect more from CodeForcesians

r,g,b=list(map(int,input().split()))
#Finding no of required cable cars of each colour
r=r//2+r%2
g=g//2+g%2
b=b//2+b%2
#finding arrival time and adding journey time
r=(r-1)*3+30
g=(g-1)*3+31
b=(b-1)*3+32
print(max(r,b,g))

#!/usr/bin/env python
# -*- coding: UTF-8 -*-
import time
import sys, io
import re, math
#start = time.clock()
l=map(int, raw_input().split())
j=-1
while(any(l)):
    l[(j+1)%3]=max(l[(j+1)%3]-2,0)
    j+=1
print j+30

r,g,b=map(int,raw_input().split())
c=0
while not (r<=0 and g<=0 and b<=0):
    if c%3==0:
        r-=2
    elif c%3==1:
        g-=2
    else:
        b-=2
    c+=1
print c+29

import math
arr = [math.ceil(int(num)/ 2)-1 for num in input().split()]
fn = lambda x: arr[x]
arr.reverse()
max_element = len(arr) - max(range(len(arr)), key = fn) - 1
print(max(arr) * 3 + 30 + max_element)

r,g,f=map(int,input().split())
c=29
while(1):
    c=c+1
    if r>=2:
        r=r-2
    elif r==1:
        r=r-1

    if r==0 and g==0 and f==0:
        break
    c=c+1
    if g>=2:
        g=g-2
    elif g==1:
        g=g-1
    if r==0 and g==0 and f==0:
        break
    c=c+1
    if f>=2:
        f=f-2
    elif f==1:
        f=f-1
    if r<=0 and g<=0 and f<=0:
        break
print(c)

#!/usr/bin/env python
from sys import stdin

def main():
  l = stdin.readline().split()
  r, g, b = int(l[0]), int(l[1]), int(l[2])
  if r > 0: r = 27 + (r+1)/2*3
  if g > 0: g = 28 + (g+1)/2*3
  if b > 0: b = 29 + (b+1)/2*3
  print max(r, max(g, b))

if __name__ == '__main__':
  main()

#!/usr/bin/python
# -*- coding: utf-8 -*-

ss = map(int,raw_input().split(' '))

cnt = 30
idx = 0
while(ss!=[0,0,0]):
    ss[idx] = max([0,ss[idx]-2])
    idx = (idx+1) % 3
    cnt += 1
print cnt - 1

a=list(map(int, input().split()))
i=t=0
while sum(a) > 0:
	if a[i%3] > 0:
		a[i%3] -= min(a[i%3], 2)
	t += 1
	i += 1
print(t+29)

r,g,b=[int(x) for x in input().split()]
x=29
while r+g+b>0:
    #print("1st",r,g,b,x)
    if r<=2:
        if (r+g+b)!=0:
            x+=1
        r=0

    else:
        r-=2
        x+=1
    #print("aftr red",r,g,b,x)

    if g<=2:
        if (r+g+b)!=0:
            x+=1
        g=0
    else:
        g-=2
        x+=1
    #print("aftr green",r,g,b,x)

    if b<=2:
        if (r+g+b)!=0:
            x+=1
        b=0
    else:
        b-=2
        x+=1

    #print("aftr blue",r,g,b,x)
print(x)

#! /usr/bin/env python

from sys import stdin

from collections import deque

def solve(start_time,Q):
	ret=0
	while Q>0:
		#print start_time,ret,Q
		ret=max(start_time+30,ret)
		Q=max(0,Q-2)
		start_time+=3
	#print "ret=",ret
	return ret

if __name__=='__main__':
	r,g,b=map(int,stdin.readline().split())
	print max([solve(x,y) for (x,y) in ((0,r),(1,g),(2,b))])

import math

line = raw_input().split()
a = float(line[0])
b = float(line[1])
c = float(line[2])

aa = math.ceil(a/2.0)
bb = math.ceil(b/2.0)
cc = math.ceil(c/2.0)

if cc >= aa and cc >= bb:
  print 29 + int(math.ceil(float(c)/float(2))) * 3 - 0
elif bb >= aa and bb >= cc:
  print 29 + int(math.ceil(float(b)/float(2))) * 3 - 1
else:
  print 29 + int(math.ceil(float(a)/float(2))) * 3 - 2

q=raw_input().split();print 30+max(i+~-int(q[i])/2*3for i in(0,1,2))

from math import ceil

[R,G,B] = [3*(ceil(int(i)/2)-1) for i in input().split()]

print(30 + max(R, G+1, B+2))

#!/usr/bin/env python2
# -*- coding: utf-8 -*-
import sys
input = sys.stdin
output = sys.stdout

def solve(r,g,b):

    def st_time(beg,N):
        n = N / 2 + N % 2
        t = beg + (n-1)*3
        return t

    tr = st_time(30,r)
    tg = st_time(31,g)
    tb = st_time(32,b)

    return max([tr,tg,tb])

Ns = input.readline().split(' ')
assert len(Ns) == 3

r = int(Ns[0])
g = int(Ns[1])
b = int(Ns[2])

n_correct = lambda n: 0<=n and n<=100
assert n_correct(r) and n_correct(g) and n_correct(b)
assert r+g+b > 0

s = solve(r,g,b)
output.write('%s\n' % s)

# import sys
# sys.stdin=open("input1.in","r")
# sys.stdout=open("OUTPUT3.out","w")
r,g,b=map(int,input().split())
count=29
while r>0 or g>0 or b>0:
	r=r-2
	count+=1
	if r<=0 and  g<=0 and b<=0:
		break
	g=g-2
	count+=1
	if r<=0 and g<=0 and b<=0:
		break
	b=b-2
	count+=1
	if r<=0 and g<=0 and b<=0:
		break
print(count)

from math import ceil as c
l=list(map(lambda x:c(int(x)/2),input().split()))
for x in range(3):
	if l[x]==max(l):a=x+1
if l==[1,0,0]:print(30)
elif l[2]==0 and max(l)==1:print(31)
elif max(l)>1:print(32+(max(l)-2)*3+a)
else:print(32)

a=list(map(int,input().split()))
t=0
while(sum(a)>0):
    for i in range(3):
        if(a[i]-2>0):
            a[i]-=2
        else:
            a[i]=0
        if(sum(a)==0):
            break
        t+=1
print(t+30)

#!/usr/bin/env python2

a = map(lambda x: ((int(x)+1)/2-1)*3 + 30, raw_input().split())
print max([a[i]+i for i in range(3)])

r,g,b = map(int,input().split())
import math
if(r==1):
    r = r-1
elif(r>=2):
    r=r-2
time = 30
sum = r+g+b
#print(sum)
while(sum>0):

    if(g>0):
        #print('green')
        if(g>=2):
            g = g - 2
            sum=sum-2
        else:
            sum=sum-g
            g = g - 1
    time = time + 1
    if(sum<=0):
        break

    #print(sum,g,time)

    if(b>0):
        #print('blue')
        if(b>=2):
            b = b - 2
            sum=sum-2
        else:
            sum=sum-b
            b = b - 1
    time = time + 1
    if(sum<=0):
        break

    #print(sum, b, time)
    if(r>0):
        if(r>=2):
            r = r - 2
            sum=sum-2
        else:
            sum=sum-r
            r = r - 1
    time = time + 1
    if(sum<=0):
        break

    #print(sum, r, time)

print(time)

students = map(int, raw_input().split())
t = 0
while True:
    students[t % 3] = max(students[t % 3] - 2, 0)
    if max(students) == 0:
        break
    t += 1
print str(t + 30)

a = list(map(int,input().split()))
b = -1
for x in range(len(a)):
	if a[x] % 2 != 0:a[x] = a[x] + 1
	if a[x] == b:a[a.index(a[x])] = 0
	elif a[x] > b:b = a[x]
c = 3 - (a.index(b) + 1) + 1
print(int(30 + ((b / 2) * 3) - c))

import math

t=list(map(int,input().split()))
for j in range(3):
    t[j]=math.ceil(t[j]/2)

d=t[::-1]

print((max(t)-1)*3+(len(t)-1-d.index(max(d))+30))

from math import ceil
r,g,b=map(int,input().split())
r,g,b=[ceil(r/2),ceil(g/2),ceil(b/2)]
if b>=r and b>=g:
	x=b
	i=2
elif g>=r and g>=b:
	x=g
	i=1
elif r>=g and r>=b:
	x=r
	i=0
print(30+(x-1)*3+i)

# -*- coding: UTF-8 -*-

# from itertools import *
# from collections import defaultdict

# def gcd(a,b):
#     while b > 0: a,b = b, a%b
#     return a

# def baseN(num,b,numerals="0123456789abcdefghijklmnopqrstuvwxyz"):
#     return ((num == 0) and  "0" ) or ( baseN(num // b, b).lstrip("0") + numerals[num % b])

# T = input()
# St = raw_input()
R, G, B = map(int, raw_input().split())
# data2 = [ map(int, raw_input().split()) for i in xrange(T) ]
i = 1
while R>0 or G>0 or B>0:
    if i%3 == 1:
        R -= 2
    if i%3 == 2:
        G -= 2
    if i%3 == 0:
        B -= 2
    i += 1
print i+28

# -*- encoding: utf-8 -*-

"""
http://codeforces.ru/contest/90/problem/A
ограничение по времени на тест: 2 seconds
ограничение по памяти на тест: 256 megabytes
ввод: standard input
вывод: standard output

A. Канатная дорога

Группа студентов хочет подняться на вершину горы, чтобы там устроить пикник. Для этого они решили воспользоваться канатной дорогой.

Канатная дорога представляет собой некоторое количество кабинок, которые подвешены с помощью каната на специальные опоры. Канат циклически прокручивается между первой и последней опорами (первая из них находится у подножья горы, а последняя — на вершине), а вместе с ним движутся и прикрепленные к нему кабинки.

Количество кабинок кратно трем и они раскрашены в три цвета — красный, зеленый и синий — таким образом, что после каждой красной кабинки идет зеленая кабинка, после каждой зеленой — синяя, а после каждой синей — красная. В каждую кабинку помещается не более двух человек. Кабинки приходят с периодичностью в одну минуту, а поднимаются наверх ровно за 30 минут.

Все студенты делятся на три группы: r из них любят кататься только в красных кабинках, g — только в зеленых и b — только в синих. Студент никогда не садится в кабинку с цветом, который ему не нравится.

Первая пришедшая кабинка (в момент времени 0) имеет красный цвет. Определите наименьшее время, за которое вся группа студентов может подняться на вершину горы.

Входные данные
В первой строке находятся три целых числа — r, g и b (0 <= r,g,b <= 100). Гарантируется, что r + g + b > 0, то есть группа состоит хотя бы из одного студента.

Выходные данные
Выведите единственное число — наименьшее время, за которое вся группа студентов может подняться на вершину горы.
"""

r, g, b = map(lambda n: (int(n) - 1) // 2, raw_input().split())

if g >= r :
    i, m = 1, g
else:
    i, m = 0, r
if b >= m:
    i, m = 2, b

print m * 3 + i + 30

l = [int(s) for s in input().split()]

minutes = 0
count = l[0] + l[1] + l[2]
while(True):
    x = minutes % 3
    if(l[x] > 0):
        count -= min(l[x],2)
        l[x] -= min(l[x],2)
    if(count <= 0):
        break
    minutes += 1
print(minutes + 30)

r,g,b = map(int,raw_input().split())

minu = 29

while(True):

	if r < 1 and g <1 and b < 1:
		break

	minu = minu + 1
	if r > 1:
		r = r - 2
	elif r > 0:
		r = r - 1

	if r < 1 and g <1 and b < 1:
		break

	minu = minu + 1
	if g > 1:
		g = g - 2
	elif g > 0:
		g = g-1

	if r < 1 and g <1 and b < 1:
		break

	minu = minu + 1
	if b > 1:
		b = b -2
	elif b > 0:
		b = b -1

print minu

def main():
    from math import ceil
    [r, g, b] = [int(_) for _ in input().split()]

    n_cars_red = ceil(r / 2)
    n_cars_green = ceil(g / 2)
    n_cars_blue = ceil(b / 2)

    last_red = (n_cars_red - 1) * 3 + 30 if n_cars_red > 0 else 0
    last_green = (n_cars_green - 1) * 3 + 31 if n_cars_green > 0 else 0
    last_blue = (n_cars_blue - 1) * 3 + 32 if n_cars_blue > 0 else 0

    print(max(last_red, last_green, last_blue))

if __name__ == '__main__':
    main()

r,g,b = map(int,raw_input().split())
r1,r2,g1,g2,b1,b2 = (r+1)/2,r%2,(g+1)/2,g%2,(b+1)/2,b%2
re = max([r1,g1,b1])
result = 29+re*3
if re*2-2<b:
    pass
else:
    if re*2-2<g:
        result -=1
    else:
        if re*2-2<r:
            result -= 2
print result

# import sys
# sys.stdin=open("input.in",'r')
# sys.stdout=open("out1.out",'w')
r,g,b=map(int,input().split())
t=29
while r+b+g:
	if r>2 :
		t+=1
		r-=2
	else:
		t+=1
		r=0
	if r+b+g==0:
		break
	if g>2:
		t+=1
		g-=2
	else:
		t+=1
		g=0
	if r+b+g==0:
		break
	if b>2:
		t+=1
		b-=2
	else:
		t+=1
		b=0
print(t)

r,g,b=map(int,input().split())
x=0
while True:
	if r>0:
		r-=2
		r=max(0,r)
		if r==g and g==b and g==0:break
		x+=1
	else:x+=1
	if g>0:
		g-=2
		g=max(0,g)
		if r==g and g==b and g==0:break
		x+=1
	else:x+=1
	if b>0:
		b-=2
		b=max(0,b)
		if r==g and g==b and g==0:break
		x+=1
	else:x+=1
print(x+30)

#!/usr/bin/python2
#-*- coding: utf-8 -*-

import sys,math

#ret = raw_input()
#ret = ret.split(' ')

#text = raw_input().rstrip()

#znak = sys.stdin.read(1)

#pole=[[]*n for r in xrange(n)]

r,g,b = map(int,raw_input().split())

minuta = 0
while r > 0 or g > 0 or b > 0 :
    if minuta % 3 == 0 :
        r -= 2
    if minuta % 3 == 1 :
        g -= 2
    if minuta % 3 == 2 :
        b -= 2
    minuta += 1
print minuta+29

from math import ceil
r, g, b = map(int, input().split())

rt = (ceil(r / 2) - 1 ) * 3
rg = 1 + ( ceil(g / 2) - 1 ) * 3
rb = 2 + ( ceil(b / 2) - 1 ) * 3

print(max(rt, rg, rb ) + 30)

a=list(map(int, input().split()))
i=t=0
while sum(a) > 0:
	if a[i%3] > 0:
		a[i%3] -= min(a[i%3], 2)
	t += 1
	i += 1
print(t+29)

#!/usr/bin/python
# -*- coding: utf-8 -*-

ss = map(int,raw_input().split(' '))

cnt = 30
idx = 0
while(ss!=[0,0,0]):
    ss[idx] = max([0,ss[idx]-2])
    idx = (idx+1) % 3
    cnt += 1
print cnt - 1

inp = map(int, raw_input().split())
i = 0
cnt = 30
while 1:
    inp[i] -= 2
    if True in map(lambda x:x > 0, inp):
        cnt += 1
        i = (i+1)%3
        continue
    print cnt
    break

q=raw_input().split();print 30+max(i+~-int(q[i])/2*3for i in(0,1,2))

from math import ceil
r,g,b=map(int,input().split())
r,g,b=max(0,r-2),max(0,g-2),max(0,b-2)
w=max(ceil(r/2)*3,ceil(g/2)*3+1,ceil(b/2)*3+2)
print(w+30)

# import sys
# sys.stdin=open("input1.in","r")
# sys.stdout=open("OUTPUT3.out","w")
r,g,b=map(int,input().split())
count=29
while r>0 or g>0 or b>0:
	r=r-2
	count+=1
	if g<=0 and b<=0:
		break
	g=g-2
	count+=1
	if b<=0:
		break
	b=b-2
	count+=1
print(count)

# import sys
# sys.stdin=open("input1.in","r")
# sys.stdout=open("OUTPUT3.out","w")
r,g,b=map(int,input().split())
count=29
while r>0 or g>0 or b>0:
	r=r-2
	count+=1
	if r<=0 and g<=0 and b<=0:
		break
	g=g-2
	count+=1
	if g<=0 and b<=0:
		break
	b=b-2
	count+=1
print(count)

r,g,b = input().split()
r = int(r)
g = int(g)
b = int(b)

div_r = (r+1)/2
div_g = (g+1)/2
div_b = (b+1)/2
ans = max(3*div_r + 27, 3*div_g + 28, 3*div_b + 29)
print(int(ans))

s=input().split();r=int(s[0]);g=int(s[1]);b=int(s[2])
if b==max(r,g,b):
    print(2+max(r,g,b)+30)
elif g==max(r,g,b):
    print(1+max(r,g,b)+30)
else:
    print(max(r,g,b)+30)

# -*- encoding: utf-8 -*-

"""
http://codeforces.ru/contest/90/problem/A
ограничение по времени на тест: 2 seconds
ограничение по памяти на тест: 256 megabytes
ввод: standard input
вывод: standard output

A. Канатная дорога

Группа студентов хочет подняться на вершину горы, чтобы там устроить пикник. Для этого они решили воспользоваться канатной дорогой.

Канатная дорога представляет собой некоторое количество кабинок, которые подвешены с помощью каната на специальные опоры. Канат циклически прокручивается между первой и последней опорами (первая из них находится у подножья горы, а последняя — на вершине), а вместе с ним движутся и прикрепленные к нему кабинки.

Количество кабинок кратно трем и они раскрашены в три цвета — красный, зеленый и синий — таким образом, что после каждой красной кабинки идет зеленая кабинка, после каждой зеленой — синяя, а после каждой синей — красная. В каждую кабинку помещается не более двух человек. Кабинки приходят с периодичностью в одну минуту, а поднимаются наверх ровно за 30 минут.

Все студенты делятся на три группы: r из них любят кататься только в красных кабинках, g — только в зеленых и b — только в синих. Студент никогда не садится в кабинку с цветом, который ему не нравится.

Первая пришедшая кабинка (в момент времени 0) имеет красный цвет. Определите наименьшее время, за которое вся группа студентов может подняться на вершину горы.

Входные данные
В первой строке находятся три целых числа — r, g и b (0 <= r,g,b <= 100). Гарантируется, что r + g + b > 0, то есть группа состоит хотя бы из одного студента.

Выходные данные
Выведите единственное число — наименьшее время, за которое вся группа студентов может подняться на вершину горы.
"""

r, g, b = map(int, raw_input().split())

if g >= r:
    i, m = 1, g
else:
    i, m = 0, r
if b >= m:
    i, m = 2, b

print ((m - 1) // 2) * 3 + i + 30

# -*- encoding: utf-8 -*-

"""
http://codeforces.ru/contest/90/problem/A
ограничение по времени на тест: 2 seconds
ограничение по памяти на тест: 256 megabytes
ввод: standard input
вывод: standard output

A. Канатная дорога

Группа студентов хочет подняться на вершину горы, чтобы там устроить пикник. Для этого они решили воспользоваться канатной дорогой.

Канатная дорога представляет собой некоторое количество кабинок, которые подвешены с помощью каната на специальные опоры. Канат циклически прокручивается между первой и последней опорами (первая из них находится у подножья горы, а последняя — на вершине), а вместе с ним движутся и прикрепленные к нему кабинки.

Количество кабинок кратно трем и они раскрашены в три цвета — красный, зеленый и синий — таким образом, что после каждой красной кабинки идет зеленая кабинка, после каждой зеленой — синяя, а после каждой синей — красная. В каждую кабинку помещается не более двух человек. Кабинки приходят с периодичностью в одну минуту, а поднимаются наверх ровно за 30 минут.

Все студенты делятся на три группы: r из них любят кататься только в красных кабинках, g — только в зеленых и b — только в синих. Студент никогда не садится в кабинку с цветом, который ему не нравится.

Первая пришедшая кабинка (в момент времени 0) имеет красный цвет. Определите наименьшее время, за которое вся группа студентов может подняться на вершину горы.

Входные данные
В первой строке находятся три целых числа — r, g и b (0 <= r,g,b <= 100). Гарантируется, что r + g + b > 0, то есть группа состоит хотя бы из одного студента.

Выходные данные
Выведите единственное число — наименьшее время, за которое вся группа студентов может подняться на вершину горы.
"""

r, g, b = map(int, raw_input().split())

if g >= r:
    i, m = 1, g
else:
    i, m = 0, r
if b >= m:
    i, m = 2, b

print (m // 2) * 3 + i + 30

import sys
import itertools
import math

lines = [i.rstrip() for i in sys.stdin.readlines()]
nums = [int(i) for i in lines[0].split(" ")]

maxi = 0
t = 0
idx = 0
for i in range(len(nums)):
    if maxi <= nums[i]:
        maxi = nums[i]
        idx = i

print int(math.ceil(float(maxi) / 2.0)) + idx + 1 + 30

import sys
import itertools
import math

lines = [i.rstrip() for i in sys.stdin.readlines()]
nums = [int(i) for i in lines[0].split(" ")]

maxi = 0
t = 0
idx = 0
for i in range(len(nums)):
    if maxi <= nums[i]:
        maxi = nums[i]
        idx = i

print int(math.floor(float(maxi) / 2.0)) * 3 + idx + 30

students = map(int, raw_input().split())
print students
t = 0
while True:
    students[t % 3] = max(students[t % 3] - 2, 0)
    if max(students) == 0:
        break
    t += 1
print str(t + 30)

r, g, b = map(int, raw_input().strip().split())

rmin = 0
gmin = 1
bmin = 2

if r > 2:
    rmin = r%2*3
if g > 2:
    gmin = 1 + g%2*3
if b > 2:
    bmin = 2 + b%2*3

print max(rmin,gmin,bmin)+30

r, g, b = map(int, raw_input().strip().split())

rmin = 0
gmin = 1
bmin = 2

if r > 2 and r%2 == 0:
    rmin = (r/2-1)*3
elif r > 2 and r%2 != 0:
    rmin = r/2*3
if g > 2 and g%2 == 0:
    gmin = 1 + (g/2-1)*3
elif g > 2 and g%2 != 0:
    gmin = 1 + g/2*3
if b > 2 and b%2 == 0:
    bmin = 2 + (b/2-1)*3
elif b > 2 and b%2 != 0:
    bmin = 2 + b/2*3
#print rmin,gmin,bmin
print max(rmin,gmin,bmin)+30

r, g, b = map(int, raw_input().strip().split())

rmin = 0
gmin = 1
bmin = 2

if r > 2 and r%2 == 0:
    rmin = (r/2-1)*3
elif r > 2 and r%2 != 0:
    rmin = r/2*3
if g > 2 and g%2 == 0:
    gmin = 1 + (g/2-1)*3
elif g > 2 and g%2 == 0:
    gmin = g1 + g/2*3
if b > 2 and b%2 == 0:
    bmin = 2 + (b/2-1)*3
elif b > 2 and b%2 != 0:
    bmin = 2 + b/2*3
#print rmin,gmin,bmin
print max(rmin,gmin,bmin)+30

r, g, b = map(int, raw_input().strip().split())

rmin = 0
gmin = 1
bmin = 2

if r > 2:
    rmin = r/2*3
if g > 2:
    gmin = 1 + g/2*3
if b > 2:
    bmin = 2 + b/2*3
#print rmin,gmin,bmin
print max(rmin,gmin,bmin)+30

import sys
line = sys.stdin.readline()
line = line.split(' ')
line = map(int,line)
ans = 0
while (max(line) >= 2):
    for i in range(len(line)):
        line[i] = line[i] - 2
    ans += 3
for i in range(3):
    if line[i] > 0:
        ans += 30 + i
if min(line) == 0:
    ans += 30
print ans

import sys
line = sys.stdin.readline()
line = line.split(' ')
line = map(int,line)
ans = 0
while (max(line) > 2):
    for i in range(len(line)):
        line[i] = line[i] - 2
    ans += 3
for i in range(3):
    if line[i] > 0:
        ans += 30 + i
print ans

def b():
	t=map(int,raw_input().split())
	for a in range(3):
		t[a]=3*((t[a]+1)>>1)-3+a
	print 30+max(t)

def b():
	t=map(int,raw_input().split())
	res=-1
	while(any(t)):
		t[(res+1)%3]=max(t[(res+1)%3]-2,0)
		res+=1
	print 30+res

#!/usr/bin/env python
# -*- coding: UTF-8 -*-
import time
import sys, io
import re, math
#start = time.clock()
r,g,b=map(int, raw_input().split())
cal=r
j=0
#より大きいか同値でずらす
if g>=r:
    cal=g
    j=1
if b>=cal:
    cal=b
    j=2

print (((cal+1)/2)-1)*3+j+30

#!/usr/bin/env python
# -*- coding: UTF-8 -*-
import time
import sys, io
import re, math
#start = time.clock()
l=map(int, raw_input().split())
cal=max(l)
j=l.index(cal)
print (((cal+1)/2)-1)*3+j+30

#!/usr/bin/env python
# -*- coding: UTF-8 -*-
import time
import sys, io
import re, math
#start = time.clock()
l=map(int, raw_input().split())
#j=-1
j=0
while(any(l)):
    l[(j+1)%3]=max(l[(j+1)%3]-2,0)
    j+=1
#print j+30
print j+29

c = list(map(int, input().split()))

m = max(c)
p = 2 - c[::-1].index(m)

res = 0
m -= 2
while m > 0:
    res += 3
    m -= 2

print(res + p + 30)

# -*- coding: utf-8 -*-
# @Date    : 2019-01-24 10:09:45
# @Author  : raj lath (oorja.halt@gmail.com)
# @Link    : link
# @Version : 1.0.0

from sys import stdin

max_val=int(10e12)
min_val=int(-10e12)

def read_int()     : return int(stdin.readline())
def read_ints()    : return [int(x) for x in stdin.readline().split()]
def read_str()     : return input()
def read_strs()    : return [x for x in stdin.readline().split()]

r, g, b = read_ints()
rtime = 0 + 3 * (r - 1) // 2
gtime = 1 + 3 * (g - 1) // 2
btime = 2 + 3 * (b - 1) // 2
print(30 + max(rtime, gtime, btime))

# -*- coding: utf-8 -*-
"""
Created on Tue May  5 17:16:25 2020

@author: alexi
"""

#https://codeforces.com/problemset/problem/90/A --- Alexis Galvan

import math

def cableway():

    people = list(map(int, input().split()))

    maximum = max(people)

    temp = 0
    for i in range(len(people)):
        if people[i] == maximum:
            index = i
            temp += 1

    if temp >= 2:
        if people[2] == maximum:
            index = 2
        elif people[1] == maximum:
            index = 1
        else:
            index = 0

    extra = 0

    if index == 0:
        if people[0] % 2 == 0:
            if people[0] - people[1] == 1 or people[0] - people[1] == 0:
                extra += 1
            if people[0] - people[2] == 1 or people[0] - people[2] == 0:
                extra += 1
        else:
            if people[0] == people[1]:
                extra += 1
            if people[0] == people[2]:
                extra += 1
    elif index == 1:
        if people[1] % 2 == 0:
            if people[1] - people[2] == 1 or people[1] - people[2] == 0:
                extra += 1
        else:
            if people[1] == people[2]:
                extra += 1

    return ((math.ceil(maximum/2)-1)*3)+(index) + 30 + extra

A = cableway()
print(A)

# -*- coding: utf-8 -*-
"""
Created on Tue May  5 17:16:25 2020

@author: alexi
"""

#https://codeforces.com/problemset/problem/90/A --- Alexis Galvan

import math

def cableway():

    people = list(map(int, input().split()))

    maximum = max(people)

    temp = 0
    for i in range(len(people)):
        if people[i] == maximum:
            index = i
            temp += 1

    if temp >= 2:
        if people[2] == maximum:
            index = 2
        elif people[1] == maximum:
            index = 1
        else:
            index = 0

    return math.ceil(maximum/2)+(index+1) + 30

A = cableway()
print(A)

# -*- coding: utf-8 -*-
"""
Created on Tue May  5 17:16:25 2020

@author: alexi
"""

#https://codeforces.com/problemset/problem/90/A --- Alexis Galvan

import math

def cableway():

    people = list(map(int, input().split()))

    maximum = max(people)

    temp = 0
    for i in range(len(people)):
        if people[i] == maximum:
            index = i
            temp += 1

    if temp >= 2:
        if people[2] == maximum:
            index = 2
        elif people[1] == maximum:
            index = 1
        else:
            index = 0

    extra = 0

    if index == 0:
        if maximum - people[1] < 2:
            extra += 1
        if maximum - people[2] < 2:
            extra += 1
    elif index == 1:
        if maximum - people[2] < 2:
            extra += 1

    return ((math.ceil(maximum/2)-1)*3)+(index) + 30 + extra

A = cableway()
print(A)

# -*- coding: utf-8 -*-
"""
Created on Tue May  5 17:16:25 2020

@author: alexi
"""

#https://codeforces.com/problemset/problem/90/A --- Alexis Galvan

import math

def cableway():

    people = list(map(int, input().split()))

    maximum = max(people)

    temp = 0
    for i in range(len(people)):
        if people[i] == maximum:
            index = i
            temp += 1

    if temp >= 2:
        if people[2] == maximum:
            index = 2
        elif people[1] == maximum:
            index = 1
        else:
            index = 0

    extra = 0
    one = True

    if index == 0:
        if people[0] % 2 == 0:
            if people[0] - people[1] == 1 or people[0] - people[1] == 0:
                extra += 1
                extra = False
            if people[0] - people[2] == 1 or people[0] - people[2] == 0:
                extra += 1
                if one:
                    extra += 1
        else:
            if people[0] == people[1]:
                extra += 1
            if people[0] == people[2]:
                extra += 1
    elif index == 1:
        if people[1] % 2 == 0:
            if people[1] - people[2] == 1 or people[1] - people[2] == 0:
                extra += 1
        else:
            if people[1] == people[2]:
                extra += 1

    return ((math.ceil(maximum/2)-1)*3)+(index) + 30 + extra

A = cableway()
print(A)

# -*- coding: utf-8 -*-
"""
Created on Tue May  5 17:16:25 2020

@author: alexi
"""

#https://codeforces.com/problemset/problem/90/A --- Alexis Galvan

import math

def cableway():

    people = list(map(int, input().split()))

    maximum = max(people)

    temp = 0
    for i in range(len(people)):
        if people[i] == maximum:
            index = i
            temp += 1

    if temp >= 2:
        if people[2] == maximum:
            index = 2
        elif people[1] == maximum:
            index = 1
        else:
            index = 0

    return ((math.ceil(maximum/2)-1)*3)+(index) + 30

A = cableway()
print(A)

r, g, b = map(int, input().split())
print(30 + max(r, g + 1, b + 2))

from math import ceil
r, g, b = map(int, input().split())
cnt = 0
if g == max(r, g, b):
    cnt = 1
if b == max(r, g, b):
    cnt = 2
print(ceil(max(r, g, b) / 2) * 3 + cnt + 27)

from math import ceil
a = list(map(int, input().split()))
mx = max(a)
b = list(reversed(a))
print(ceil(mx // 2) * 30 + 2 - b.index(mx) + mx)

from math import ceil
r, g, b = map(lambda x: ceil(int(x) / 2) * 3, input().split())
print(27 + max(r, g + 1, b + 1))

import math
arr = [math.ceil(int(num)/ 2)-1 for num in input().split()]
fn = lambda x: arr[x]
print(max(arr) * 3 + 30 + max(range(len(arr)), key = fn))

x=list(map(int, input().split()))
c=max(x)
ind=x[::-1].index(c)
print(30+(c+1)//2*3-ind-1)

from math import ceil

X, i, Found, Sum = [ceil(i / 2) for i in map(int, input().split())], 2, False, 0
while i >= 0:
    if X[i] == max(X):
        Found = True
    Sum += (X[i] if not Found else max(X))
    i -= 1
print(Sum + 29)

# UB_CodeForces
# Advice: Keep an eye on your goals
# Location: At home next to a cup of thyme tea
# Caption: I expect more from CodeForcesians

from math import ceil
a,b,c = map(int,input().split())
t = max(a,b,c)
if t == c:
	print(32+3*ceil((c-2)/2))
elif t == b:
	print(31+3*ceil((b-2)/2))
elif t == a:
	print(30+3*ceil((a-2)/2))

a,b,c = map(int,input().split())
t = max(a,b,c)
if t == a:
	print(30+a//2+2)
if t == b:
	print(30+b//2+3)
if t == c:
	print(30+c//2+4)

from math import ceil
a,b,c = map(int,input().split())
t = max(a,b,c)
if t == c:
	print(32+3*ceil((c-2)/2))
elif t == b:
	print(31+3*ceil((b-2)/2))
elif t == c:
	print(30+3*ceil((a-2)/2))

from math import ceil
a,b,c = map(int,input().split())
t = max(a,b,c)
if t == c:
	print(32+3*ceil((c-2)/2))
elif t == b:
	print(31+3*(ceil(b-2)/2))
elif t == c:
	print(30+3*(ceil(a-2)/2))

r, g, b = map(int, input().split())

ma = max(r, max(g, b))
k = (ma // 2 + ma % 2) * 3 + 30
if ma == b:
	print(k - 1)
elif ma == g:
	print(k - 2)
else:
	print(k - 3)

r, g, b = map(int, input().split())

ma = max(r, max(g, b))
t = [b, g, r]
i = t.index(ma)
if i == 0:
    print(30 + ma // 2 * 3 + 2)
elif i == 1:
    print(30 + ma // 2 * 3 + 1)
else:
    print(30 + ma // 2 * 3)

import math
r,g,b=map(int,input().split())
r,g,b=math.ceil(r/2),math.ceil(g/2),math.ceil(b/2)
large=max(r,g,b)
if(large==0):
    print("0")
elif(large==b and b>0):
    print(32+3*(b-1))
elif(large==g and g>0):
    print(32+2*(g-1))
else:
    print(r+31)

#!/usr/bin/python3

t = 0
r, g, b = map(int, input().split())

while r + g + b > 0:
    r -= min(r, 2)
    t += 1
    r, g, b = g, b, r

print(t + 30)

from math import ceil as c
r,g,b = map(int,input().split())
k = max(r,g,b)
if r==g==b:
	print(29+3*(c(k/2)))
elif k==r:
	print(30+3*c((k/2)-1))
elif k==g:
	print(31+3*c((k/2)-1))
else:
	print(32+3*c((k/2)-1))

from math import ceil as c
l=list(map(lambda x:c(int(x)/2),input().split()))
for x in range(3):
	if l[x]==max(l):a=x+1
if l[2]==0 and max(l)==1:print(31)
elif max(l)>1:print(32+(max(l)-2)*3+a)
else:print(32)

from math import ceil as c
l=list(map(lambda x:c(int(x)/2),input().split()))
for x in range(3):
	if l[x]==max(l):a=x+1
if l[2]==0 and max(l)==1:print(31)
elif max(l)>1:print(32+max(l)-2+a)
else:print(32)

from math import ceil
r,g,b = map(int,input().split())
maxi = max(r,g,b)
if maxi == b:
    print(32+ceil((b-2)/2)*3)
elif maxi == g:
    print(31+ceil((g-2)/2)*3)
else:
    print(30+ceil((r-2)/2)*3)

from math import ceil
a,b,c = map(int,input().split())
r,g,b = ceil(a/2),ceil(b/2),ceil(c/2)
maxi = max(r,g,b)
if maxi == b:
	print(32+3*ceil((c-2)/2))
elif maxi == g:
	print(31+3*ceil((b-2)/2))
elif maxi == r:
	print(30+3*ceil((a-2)/2))

r,g,b = map(int,input().split())
ans = 30
if r >= 2:
    r = r-2
else:
    r = 0
if r >= g and r >= b:
    d = (r//2 + r%2)
    ans+= d*3
elif g > r and g > b:
    d = (g//2)+g%2
    ans+= d+(d-1)*2
else:
    d = b//2+b%2
    ans+= d*3-1
print(ans)

r,g,b = map(int,input().split())
ans = 30
if r >= 2:
    r = r-2
else:
    r = 0
if r+2 >= g and r+2 >= b:
    d = (r//2 + r%2)
    ans+= d*3
elif g > r and g > b:
    d = (g//2)+g%2
    ans+= d+(d-1)*2
else:
    d = b//2+b%2
    ans+= d*3-1
print(ans)

from math import ceil
r,g,b = map(int,input().split())
maxi = max(r,g,b)
if maxi == b:
    print(32+ceil((c-2)/2)*3)
elif maxi == g:
    print(31+ceil((b-2)/2)*3)
else:
    print(30+ceil((r-2)/2)*3)

r,g,b = map(int,input().split())
ans = 30
if r >= 2:
    r = r-2
else:
    r = 0
if r+2 > g and r+2 > b:
    d = (r//2 + r%2)
    ans+= d*3
elif g > r and g > b:
    d = (g//2)+g%2
    ans+= d+(d-1)*2
else:
    d = b//2+b%2
    ans+= d*3-1
print(ans)

import math
a = list(map(int,input().split()))
b = 0
d = 0
for x in a:
	if x > b: b = x
if a.count(b) > 1:
	for x in range(a.count(b) - 1):a[a.index(b)] = 0
c = math.ceil(b / 2)
b = 3 - (a.index(b) + 1)
print(30 + ((c * 3)) - 1 -b)

import math
a = list(map(int,input().split()))
b = 0
d = 0
for x in range(len(a)):
	if a[x] % 2 != 0:a[x] = a[x] + 1
	if x > b:b = a[x]
if a.count(b) > 1:
	for x in range(a.count(b) - 1):a[a.index(b)] = 0
c = math.ceil(b / 2)
b =(3 - (a.index(b) + 1)) + 1
print(30 + ((c * 3)) -b)

r,g,b=map(int,raw_input().split())
t=0
while r>0 or g>0 or b>0:
    if t%3==0:
        r-=2
    elif t%3==1:
        g-=2
    else:
        b-=2
    t += 1
t += 30
print t

from sys import stdin

a, b, c = [int(x) for x in stdin.readline().split()]
time = 0
while a > 0 or b > 0 or c > 0:
    if c > 0:
        time += 3
        a -= 2
        b -= 2
        c -= 2
    elif b > 0:
        time += 2
        a -= 2
        b -= 2
    elif a > 0:
        time += 1
        a -= 2

print time + 29

s = map(int,raw_input().split())
r = 29+(max(s)/2)*3
if max(s)%2==0:
    r = r-3
if s[2]==max(s):
    r+=3
    print r
    exit(0)
elif s[1]==max(s):
    r+=2
    print r
    exit(0)
else:
    r+=1
    print r

s = map(int,raw_input().split())
r = 29+(max(s)/2)*3
if s[2]==max(s):
    r+=(s[2]%2)*3
    print r
    exit(0)
elif s[1]==max(s):
    r+=(s[1]%2)*2
    print r
    exit(0)
else:
    r+=(s[0]%2)
    print r

#!/usr/bin/env python
# -*- coding: utf-8 -*-

r, g, b = map(int, raw_input().split())
t = -1
while (r > 0 or g > 0 or b > 0):
    if b > 0:
        r -= 2
        g -= 2
        b -= 2
        t += 3
    elif g > 0:
        r -= 2
        g -= 2
        t += 2
    elif r > 0:
        r -= 2
        t += 1
print t + 30

s = raw_input().split()
r = int(s[0])
g = int(s[1])
b = int(s[2])

M = max(r, g, b)
if b == M:
    p = 2
elif g == M:
    p = 1
else:
    p = 0

print (M - 1) / 2 * 3 + p + 30

p = [ int(x) for x in raw_input().strip().split() ]

res = 0
t = 0
while sum(p) > 0:
    print p
    p[t % 3] -= min(2, p[t % 3])
    t += 1
    res += 1

print res + 29

import sys
from math import ceil

r, g, b = map(int, sys.stdin.readline().split())

tr = ceil(r/2.0)
tg = ceil(g/2.0)
tb = ceil(b/2.0)

xr = 3*(tr-1)
xg = 3*(tg-1)+1
xb = 3*(tb-1)+2

print xr, xg, xb

print int(30+max([xr, xg, xb]))

import math

line = raw_input().split()
a = int(line[0])
b = int(line[1])
c = int(line[2])

if a == 0 and b == 0 and c == 0:
  print 0
elif c >= a and c >= b:
  print 29 + int(math.ceil(float(c)/float(2))) * 3 - 0
elif b >= a and b >= c:
  print 29 + int(math.ceil(float(b)/float(2))) * 3 - 1
else:
  print 29 + int(math.ceil(float(a)/float(2))) * 3 - 2

import math

line = raw_input().split()
a = int(line[0])
b = int(line[1])
c = int(line[2])

if a == 0 and b == 0 and c == 0:
  print 0
elif c >= a and c >= b:
  print 30 + (3 * int(math.floor(float(c)/float(2))) + 2)
elif b >= a and b >= c:
  print 30 + (3 * int(math.floor(float(b)/float(2))) + 1)
else:
  print 30 + (3 * int(math.floor(float(a)/float(2))) )

import math

line = raw_input().split()
a = int(line[0])
b = int(line[1])
c = int(line[2])

if a == 0 and b == 0 and c == 0:
  print 0
elif c >= a and c >= b:
  print 30 + (3 * int(math.floor(float(c)/float(2))) - 1)
elif b >= a and b >= c:
  print 30 + (3 * int(math.floor(float(b)/float(2))) + 1)
else:
  print 30 + (3 * int(math.floor(float(a)/float(2))) )

r,g,b = map(int,input().split())

cnt = 0

while(r!=0 or b!=0 or g !=0 ) :
    #print("flag")

    for i in range(3) :

        if i==0 and r!=0:

            r = r-2

            if r<0 :

                r = 0

            cnt = cnt + 1

        if i ==1 and g!=0 :

            g = g-2

            if g<0 :

                g = 0

            cnt =cnt + 1
        if i==2 and b!=0 :

            b = b-2

            if b<0 :

                b = 0

            cnt = cnt + 1

        #print(cnt)
        #print(r,g,b)

print(cnt+30)

#!/usr/bin/env python
import os
import sys
from io import BytesIO, IOBase
from math import ceil

def main():
    rgb_list = list(map(int, input().split()))
    result = 30
    MAX_PEOPLE_CAN_GO_IN_CABLE_CAR = 2
    color_mapping = {"red": rgb_list[0], "green": rgb_list[1], "blue": rgb_list[2]}
    total_people = len(rgb_list)
    for i in range(3, total_people, 3):
        if(i < total_people):
            color_mapping["red"] += rgb_list[i]
        if(i+1 < total_people):
            color_mapping["green"] += rgb_list[i+1]
        if(i+2 < total_people):
            color_mapping["blue"] += rgb_list[i+2]
        if(i >= total_people):
            break
    for color_name, color_value in color_mapping.items():
        # import ipdb; ipdb.set_trace()
        if color_name == "red" and color_value > MAX_PEOPLE_CAN_GO_IN_CABLE_CAR:
            color_value -= MAX_PEOPLE_CAN_GO_IN_CABLE_CAR
        elif color_name == "red" and color_value <= MAX_PEOPLE_CAN_GO_IN_CABLE_CAR:
            continue
        if color_name == "red" or color_value > MAX_PEOPLE_CAN_GO_IN_CABLE_CAR:
            result += ceil(color_value / MAX_PEOPLE_CAN_GO_IN_CABLE_CAR)
            if color_value % MAX_PEOPLE_CAN_GO_IN_CABLE_CAR != 0:
                result += 1
        else:
            result += 1
    sys.stdout.write(str(result))

# region fastio

BUFSIZE = 8192

class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)

class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")

sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")

# endregion

if __name__ == "__main__":
    main()

#!/usr/bin/env python
import os
import sys
from io import BytesIO, IOBase
from math import ceil

def main():
    rgb_list = list(map(int, input().split()))
    result = 30
    MAX_PEOPLE_CAN_GO_IN_CABLE_CAR = 2
    color_mapping = {"red": rgb_list[0], "green": rgb_list[1], "blue": rgb_list[2]}
    total_people = len(rgb_list)
    for i in range(3, total_people, 3):
        if(i < total_people):
            color_mapping["red"] += rgb_list[i]
        if(i+1 < total_people):
            color_mapping["green"] += rgb_list[i+1]
        if(i+2 < total_people):
            color_mapping["blue"] += rgb_list[i+2]
        if(i >= total_people):
            break
    for color_name, color_value in color_mapping.items():
        if color_name == "red" and color_value > MAX_PEOPLE_CAN_GO_IN_CABLE_CAR:
            color_value -= MAX_PEOPLE_CAN_GO_IN_CABLE_CAR
        elif color_name == "red" and color_value <= MAX_PEOPLE_CAN_GO_IN_CABLE_CAR:
            continue
        if color_value == "red" or color_value > MAX_PEOPLE_CAN_GO_IN_CABLE_CAR:
            result += ceil(color_value / MAX_PEOPLE_CAN_GO_IN_CABLE_CAR)
            if color_value > MAX_PEOPLE_CAN_GO_IN_CABLE_CAR and color_value % MAX_PEOPLE_CAN_GO_IN_CABLE_CAR != 0:
                result += 1
        else:
            result += 1
    sys.stdout.write(str(result))

# region fastio

BUFSIZE = 8192

class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)

class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")

sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")

# endregion

if __name__ == "__main__":
    main()

#!/usr/bin/env python
import os
import sys
from io import BytesIO, IOBase
from math import ceil

def main():
    rgb_list = list(map(int, input().split()))
    result = 30
    MAX_PEOPLE_CAN_GO_IN_CABLE_CAR = 2
    color_mapping = {"red": rgb_list[0], "green": rgb_list[1], "blue": rgb_list[2]}
    total_people = len(rgb_list)
    for i in range(3, total_people, 3):
        if(i < total_people):
            color_mapping["red"] += rgb_list[i]
        if(i+1 < total_people):
            color_mapping["green"] += rgb_list[i+1]
        if(i+2 < total_people):
            color_mapping["blue"] += rgb_list[i+2]
        if(i >= total_people):
            break
    for color_name, color_value in color_mapping.items():
        if color_name == "red" and color_value > MAX_PEOPLE_CAN_GO_IN_CABLE_CAR:
            color_value -= MAX_PEOPLE_CAN_GO_IN_CABLE_CAR
        elif color_name == "red" and color_value <= MAX_PEOPLE_CAN_GO_IN_CABLE_CAR:
            continue
        if color_value == "red" or color_value > MAX_PEOPLE_CAN_GO_IN_CABLE_CAR:
            result += ceil(color_value / MAX_PEOPLE_CAN_GO_IN_CABLE_CAR)
            if color_value % MAX_PEOPLE_CAN_GO_IN_CABLE_CAR != 0:
                result += 1
        else:
            result += 1
    sys.stdout.write(str(result))

# region fastio

BUFSIZE = 8192

class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)

class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")

sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")

# endregion

if __name__ == "__main__":
    main()

import sys
import math

#to read string
get_string = lambda: sys.stdin.readline().strip()
#to read list of integers
get_int_list = lambda: list( map(int,sys.stdin.readline().strip().split()) )
#to read integers
get_int = lambda: int(sys.stdin.readline())

#--------------------------------WhiteHat010--------------------------------------#
r,g,b = get_int_list()
if r>g and r>b:
    print( ((r-min(r,2))//2 + (r-min(r,2))%2 )*3 + 30  )
elif g>r and g>b:
    print( ((g-min(g,2))//2 + (g-min(g,2))%2 )*3 + 1 + 30  )
else:   # b>g and b>r:
    print( ((b-min(b,2))//2 + (b-min(b,2))%2 )*3 + 2 + 30  )

import sys
import math

#to read string
get_string = lambda: sys.stdin.readline().strip()
#to read list of integers
get_int_list = lambda: list( map(int,sys.stdin.readline().strip().split()) )
#to read integers
get_int = lambda: int(sys.stdin.readline())

#--------------------------------WhiteHat010--------------------------------------#
r,g,b = get_int_list()
if r>g and r>b:
    print( ((r-2)//2 + (r-2)%2 )*3 + 30  )
elif g>r and g>b:
    print( ((g-2)//2 + (g-2)%2 )*3 + 1 + 30  )
else:   # b>g and b>r:
    print( ((b-2)//2 + (b-2)%2 )*3 + 2 + 30  )

import sys
import math

#to read string
get_string = lambda: sys.stdin.readline().strip()
#to read list of integers
get_int_list = lambda: list( map(int,sys.stdin.readline().strip().split()) )
#to read integers
get_int = lambda: int(sys.stdin.readline())

#--------------------------------WhiteHat010--------------------------------------#
r,g,b = get_int_list()
if r>g and r>b:
    t = 30
    r = r-min(r,2)
    if r>0:
        t += (r//2 + r%2)*3
    print(t)
elif g>r and g>b:
    t = 31
    g = g-min(g,2)
    if g>0:
        t += (g//2 + g%2)*3
    print(t)
else:   # b>g and b>r:
    t = 32
    b = b-min(b,2)
    if b>0:
        t += (b//2 + b%2)*3
    print(t)

def f(l):
    mx = 0
    mp = 0
    for i in range(3):
        if l[i] >= mx:
            mx   = l[i]
            mp   = i
    t  = ((mx-1)//2)*3 + mp
    return t + 30

l = list(map(int,input().split()))
print(f(l))

import sys
import math
import bisect
import itertools
import random
import re

def main():
    r, g, b = map(int, input().split())
    max_val = 0
    if r:
        val = ((r + 1) // 2 - 1) * 3 + 30
        max_val = max(max_val, val)
    if g:
        val = ((g + 1) // 2 - 1) * 3 + 1 + 30
        max_val = max(max_val, val)
    if b:
        val = ((b + 1) // 2 - 1) * 3 + 1 + 30
        max_val = max(max_val, val)
    print(max_val)

if __name__ == "__main__":
    main()

import math
r,g,b = map(int,input().split(" "))
t = 30
r = math.ceil(r/2)
g = math.ceil(g/2)
b = math.ceil(b/2)
max = r
if(b>=r and b>=g):
    max = b
    t = t + 2
if(g>=r and g>=b):
    max = g
    t = t + 1
print(t + (max-1)*3)

a  = list(map(int, input().rstrip().split(" ")))

m = max(a)
total = m//2 + m%2
ind = 0
for i in range(3):
    if a[i] == m:
        ind = i+1
total = 30 + 3*(total-1) + ind - 1
print(total)

import math

t=list(map(int,input().split()))
for j in range(3):
    t[j]=math.ceil(t[j]/2)

print((max(t)-1)*3+t.index(max(t))+30)

r,g,b = map(int,input().split())
import math
if(r==1):
    r = r-1
elif(r>=2):
    r=r-2
time = 30
sum = r+g+b
print(sum)
while(sum>0):

    if(g>0):
        #print('green')
        if(g>=2):
            g = g - 2
            sum=sum-2
        else:
            sum=sum-g
            g = g - 1
    time = time + 1
    if(sum<=0):
        break

    #print(sum,g,time)

    if(b>0):
        #print('blue')
        if(b>=2):
            b = b - 2
            sum=sum-2
        else:
            sum=sum-b
            b = b - 1
    time = time + 1
    if(sum<=0):
        break

    #print(sum, b, time)
    if(r>0):
        if(r>=2):
            r = r - 2
            sum=sum-2
        else:
            sum=sum-r
            r = r - 1
    time = time + 1
    if(sum<=0):
        break

    #print(sum, r, time)

print(time)