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