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

pie = (3*A + P) / 2
if pie*2 % 2 == 0:
    print(int(pie))
elif pie*2 % 2 == 1:
    print(int(pie - 0.5)) A,P = map(int,input().split()) A map(int,input().split()) map int input().split() ().split () input split P pie = (3*A + P) / 2 pie (3*A + P) / 2 3*A + P 3*A 3 A P 2 if pie*2 % 2 == 0:
    print(int(pie))
elif pie*2 % 2 == 1:
    print(int(pie - 0.5)) pie*2 % 2 == 0 pie*2 % 2 pie*2 pie 2 2 0 print(int(pie)) print int(pie) int pie elif pie*2 % 2 == 1:
    print(int(pie - 0.5)) pie*2 % 2 == 1 pie*2 % 2 pie*2 pie 2 2 1 print(int(pie - 0.5)) print int(pie - 0.5) int pie - 0.5 pie 0.5 A,P = map(int,input().split()) map(int,input().split()) A P = map(int,input().split()) map(int,input().split()) P pie = (3*A + P) / 2 (3*A + P) / 2 pie
A,P = map(int,input().split())

pie = (3*A + P) / 2
if pie*2 % 2 == 0:
    print(int(pie))
elif pie*2 % 2 == 1:
    print(int(pie - 0.5))