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