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

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

p += a*3
ans = int(p/2)
print(ans)