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