A, P = list(map(int, input().split()))



P += A * 3



pie = P // 2



print(pie)

def resolve():

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

  print(((a*3+p) // 2))

  return



if __name__ == "__main__":

  resolve()

A, P = list(map(int, input().split()))
P += A * 3
pie = P // 2
print(pie)

def resolve():
    a, p = list(map(int, input().split()))
    print(((a * 3 + p) // 2))
    return


if __name__ == "__main__":
    resolve()

-A, P = list(map(int, input().split())) -P += A * 3 -pie = P // 2 -print(pie) +def resolve(): +    a, p = list(map(int, input().split())) +    print(((a * 3 + p) // 2)) +    return + + +if __name__ == "__main__": +    resolve()