day = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
sumn = 0
for i in range(len(day)):
    for j in range(day[i]):
        stl = list(map(int, list(str(j)) if j >= 10 else [0, str(j)]))
        if i == stl[0] + stl[1]:
            sumn += 1
print(sumn)