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

parts = 3 * A + P

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

parts = 3 * A + P

if parts % 2 == 0:
    print(round(parts / 2))
else:
    print(round((parts - 1) / 2))