import itertools
import fractions
def main():
  a,p = map(int,input().split())
  sur = p % 2
  print((p//2) + ((a*3)+sur)//2)
if __name__ == '__main__':
  main() import itertools itertools import fractions fractions def main():
  a,p = map(int,input().split())
  sur = p % 2
  print((p//2) + ((a*3)+sur)//2) main a,p = map(int,input().split()) a map(int,input().split()) map int input().split() ().split () input split p sur = p % 2 sur p % 2 p 2 print((p//2) + ((a*3)+sur)//2) print (p//2) + ((a*3)+sur)//2 p//2 p 2 ((a*3)+sur)//2 (a*3)+sur a*3 a 3 sur 2 if __name__ == '__main__':
  main() __name__ == '__main__' __name__ '__main__' main() main def main():
  a,p = map(int,input().split())
  sur = p % 2
  print((p//2) + ((a*3)+sur)//2) def main():
  a,p = map(int,input().split())
  sur = p % 2
  print((p//2) + ((a*3)+sur)//2) main
import itertools
import fractions
def main():
  a,p = map(int,input().split())
  sur = p % 2
  print((p//2) + ((a*3)+sur)//2)
if __name__ == '__main__':
  main()