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

apple_fragment = A * 3 + P
apple_pie = apple_fragment // 2

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

apple_fragment = A * 3 + P
apple_pie = apple_fragment // 2

print(apple_pie)