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

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

p += 3*a
pi = p//2
print(pi)
