data=input().split()
A=int(data[0])
P=int(data[1])
ans_pre=3*A+P
ans=ans_pre//2
print(ans) data=input().split() data input().split() ().split () input split A=int(data[0]) A int(data[0]) int data[0] data 0 P=int(data[1]) P int(data[1]) int data[1] data 1 ans_pre=3*A+P ans_pre 3*A+P 3*A 3 A P ans=ans_pre//2 ans ans_pre//2 ans_pre 2 print(ans) print ans ans_pre=3*A+P 3*A+P ans_pre P=int(data[1]) int(data[1]) P A=int(data[0]) int(data[0]) A ans=ans_pre//2 ans_pre//2 ans data=input().split() input().split() data
data=input().split()
A=int(data[0])
P=int(data[1])
ans_pre=3*A+P
ans=ans_pre//2
print(ans)