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

x = (A * 3) + P

if x >= 2:
  y = x / 2
else:
  y = 0

print(int(y)) A, P = map(int, input().split()) A map(int, input().split()) map int input().split() ().split () input split P x = (A * 3) + P x (A * 3) + P A * 3 A 3 P if x >= 2:
  y = x / 2
else:
  y = 0 x >= 2 x 2 y = x / 2 y x / 2 x 2 y = 0 y 0 print(int(y)) print int(y) int y P = map(int, input().split()) map(int, input().split()) P x = (A * 3) + P (A * 3) + P x y = x / 2 x / 2 y y = 0 0 y A, P = map(int, input().split()) map(int, input().split()) A
A, P = map(int, input().split())

x = (A * 3) + P

if x >= 2:
  y = x / 2
else:
  y = 0

print(int(y))