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

if ( A * 3 + P ) % 2 == 0:
  print(int( ( A * 3 + P ) / 2 ))
else:
  print( int(( A * 3 + P - 1) / 2 )) A,P = map(int,input().split()) A map(int,input().split()) map int input().split() ().split () input split P if ( A * 3 + P ) % 2 == 0:
  print(int( ( A * 3 + P ) / 2 ))
else:
  print( int(( A * 3 + P - 1) / 2 )) ( A * 3 + P ) % 2 == 0 ( A * 3 + P ) % 2 A * 3 + P A * 3 A 3 P 2 0 print(int( ( A * 3 + P ) / 2 )) print int( ( A * 3 + P ) / 2 ) int ( A * 3 + P ) / 2 A * 3 + P A * 3 A 3 P 2 print( int(( A * 3 + P - 1) / 2 )) print int(( A * 3 + P - 1) / 2 ) int ( A * 3 + P - 1) / 2 A * 3 + P - 1 A * 3 + P A * 3 A 3 P 1 2 P = map(int,input().split()) map(int,input().split()) P A,P = map(int,input().split()) map(int,input().split()) A
A,P = map(int,input().split())

if ( A * 3 + P ) % 2 == 0:
  print(int( ( A * 3 + P ) / 2 ))
else:
  print( int(( A * 3 + P - 1) / 2 ))