require 'date' puts ((Date.new(2015, 1, 1)..Date.new(2015, 12, 31)).count do |d| d.month == (d.day / 10) + (d.day % 10) end)