import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines sys.setrecursionlimit(10 ** 7) m = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31] cnt = 0 for i in range(12): for j in range(m[i]): if i + 1 == sum(list(map(int, list(str(j + 1))))): cnt += 1 print(cnt)