a, p = map(int, input().split())

hahen = a*3 + p
pie = (hahen)//2
print(pie)  a, p = map(int, input().split()) a map(int, input().split()) map int input().split() ().split () input split p hahen = a*3 + p hahen a*3 + p a*3 a 3 p pie = (hahen)//2 pie (hahen)//2 hahen 2 print(pie) print pie a, p = map(int, input().split()) map(int, input().split()) a p = map(int, input().split()) map(int, input().split()) p hahen = a*3 + p a*3 + p hahen pie = (hahen)//2 (hahen)//2 pie
a, p = map(int, input().split())

hahen = a*3 + p
pie = (hahen)//2
print(pie) 