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

while(a != 0):
    a -= 1
    p += 3

print(int(p / 2)) a, p = map(int, input().split()) a map(int, input().split()) map int input().split() ().split () input split p while(a != 0):
    a -= 1
    p += 3 a != 0 a 0 a -= 1 a 1 p += 3 p 3 print(int(p / 2)) print int(p / 2) int p / 2 p 2 a -= 1 1 a a, p = map(int, input().split()) map(int, input().split()) a p = map(int, input().split()) map(int, input().split()) p p += 3 3 p
a, p = map(int, input().split())

while(a != 0):
    a -= 1
    p += 3

print(int(p / 2))