A,P = map(int,input().split())
B = A*3 + P
print(int(B//2)) A,P = map(int,input().split()) A map(int,input().split()) map int input().split() ().split () input split P B = A*3 + P B A*3 + P A*3 A 3 P print(int(B//2)) print int(B//2) int B//2 B 2 A,P = map(int,input().split()) map(int,input().split()) A P = map(int,input().split()) map(int,input().split()) P B = A*3 + P A*3 + P B
A,P = map(int,input().split())
B = A*3 + P
print(int(B//2))