L=[32,29,32,31,32,31,32,32,31,32,31,32] O=0 for i in range(12): for j in range(1,L[i]): A=j//10+j%10-1 if i==A:O+=1 print(O)