require("Date") date=Date.new(2015,1,1) len=date.leap? ? 366 : 365 o = 0 len.times{ o+=1 if date.month==date.day/10+date.day%10 date+=1 } puts o