N_apple, N_P = map(int, input().split())

summ = 3 * N_apple + N_P
ans = summ // 2

print(ans) N_apple, N_P = map(int, input().split()) N_apple map(int, input().split()) map int input().split() ().split () input split N_P summ = 3 * N_apple + N_P summ 3 * N_apple + N_P 3 * N_apple 3 N_apple N_P ans = summ // 2 ans summ // 2 summ 2 print(ans) print ans N_apple, N_P = map(int, input().split()) map(int, input().split()) N_apple N_P = map(int, input().split()) map(int, input().split()) N_P summ = 3 * N_apple + N_P 3 * N_apple + N_P summ ans = summ // 2 summ // 2 ans
N_apple, N_P = map(int, input().split())

summ = 3 * N_apple + N_P
ans = summ // 2

print(ans)