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