m = [i for i in range(1, 13)] d = [i//10 + i%10 for i in range(1, 31)] cnt = 0 for i in m: for j in d: if i == j: cnt += 1 print(cnt)