A, P = map(int, input().split())

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

total = A*3+P
print(int(total/2))