days=[31,28,31,30,31,30,31,31,30,31,30,31] s=0 for X in 1..12 for Y in 1..days[X-1] if X==Y/10+Y%10 s+=1 end end end puts s