a,p = map(int,input().split())

if (3*a+p)%2 == 0:
    print((3*a+p)//2)
else:
    print((3*a+p-1)//2) a,p = map(int,input().split()) a map(int,input().split()) map int input().split() ().split () input split p if (3*a+p)%2 == 0:
    print((3*a+p)//2)
else:
    print((3*a+p-1)//2) (3*a+p)%2 == 0 (3*a+p)%2 3*a+p 3*a 3 a p 2 0 print((3*a+p)//2) print (3*a+p)//2 3*a+p 3*a 3 a p 2 print((3*a+p-1)//2) print (3*a+p-1)//2 3*a+p-1 3*a+p 3*a 3 a p 1 2 p = map(int,input().split()) map(int,input().split()) p a,p = map(int,input().split()) map(int,input().split()) a
a,p = map(int,input().split())

if (3*a+p)%2 == 0:
    print((3*a+p)//2)
else:
    print((3*a+p-1)//2)