import sys from collections import deque,defaultdict import itertools import heapq import bisect import math #sys.setrecursionlimit(10 ** 9) input = lambda: sys.stdin.readline().rstrip() ii = lambda: int(input()) mi = lambda: map(int, input().split()) ml = lambda: map(str, input().split()) li = lambda: list(mi()) li_st = lambda: list(map(str, input().split())) lli = lambda n: [li() for _ in range(n)] mod = 998244353 ans = 0 lis = [31,28,31,30,31,30,31,31,30,31,30,31] for i in range(12): num1 = i+1 for j in range(1,lis[i]+1): s = str(j) if len(s) >= 2: num2 = int(s[0]) + int(s[1]) else: num2 = j if num1 == num2: ans += 1 print(ans)