c = 0 for m in range(12): for d in range(31): M = m +1 D = d+1 if D>=10: a,b=map(int, str(D)) else: a = D b = 0 if a+b ==M: c += 1 print(c-1)