require 'date' d = Date.new(2015, 1, 1) ans = 0 while d.year == 2015 if d.month == d.day / 10 + d.day % 10 ans += 1 end d += 1 end puts ans