require"date" puts Date.new(2015,1,1).upto(Date.new(2015,12,31)).select{|d|d.month==d.day.to_s.chars.map(&:to_i).inject(:+)}.size