import math

a,p=(map(int,input().split()))
if a>0:
  p=int(a*3+p)
elif a==0:
  pass
if p%2==1:
  print(math.floor(p/2))
else:
  print(int(p/2)) import math math a,p=(map(int,input().split())) a map(int,input().split()) map int input().split() ().split () input split p if a>0:
  p=int(a*3+p)
elif a==0:
  pass a>0 a 0 p=int(a*3+p) p int(a*3+p) int a*3+p a*3 a 3 p elif a==0:
  pass a==0 a 0 if p%2==1:
  print(math.floor(p/2))
else:
  print(int(p/2)) p%2==1 p%2 p 2 1 print(math.floor(p/2)) print math.floor(p/2) math.floor math floor p/2 p 2 print(int(p/2)) print int(p/2) int p/2 p 2 a,p=(map(int,input().split())) map(int,input().split()) a p=int(a*3+p) int(a*3+p) p p=(map(int,input().split())) map(int,input().split()) p
import math

a,p=(map(int,input().split()))
if a>0:
  p=int(a*3+p)
elif a==0:
  pass
if p%2==1:
  print(math.floor(p/2))
else:
  print(int(p/2))