A,P=map(int,input().split())
ans,maru,kakera = 0,0,0
def is_even(num):
    return num % 2 == 0
maru=3*A//2
if P==0:
    kakera=0
else:
    if is_even(A) == True:
        kakera = P//2
    else:
        kakera = P//2+1
ans=maru+kakera
print(ans)