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