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

a = A*3 + P

if a > 0:
  print(int(a/2))
else:
  print(0) A, P = map(int, input().split()) A map(int, input().split()) map int input().split() ().split () input split P a = A*3 + P a A*3 + P A*3 A 3 P if a > 0:
  print(int(a/2))
else:
  print(0) a > 0 a 0 print(int(a/2)) print int(a/2) int a/2 a 2 print(0) print 0 a = A*3 + P A*3 + P a 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())

a = A*3 + P

if a > 0:
  print(int(a/2))
else:
  print(0)
