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

a_p=a*3
p_total=a_p+p
print(p_total//2) a,p=map(int,input().split()) a map(int,input().split()) map int input().split() ().split () input split p a_p=a*3 a_p a*3 a 3 p_total=a_p+p p_total a_p+p a_p p print(p_total//2) print p_total//2 p_total 2 a_p=a*3 a*3 a_p a,p=map(int,input().split()) map(int,input().split()) a p=map(int,input().split()) map(int,input().split()) p p_total=a_p+p a_p+p p_total
a,p=map(int,input().split())

a_p=a*3
p_total=a_p+p
print(p_total//2)