require 'date' class Yukicoder def initialize @n = gets.to_i end def run origin_wday = Date.parse('20140723').wday cnt = 0 2015.upto(@n) do |y| d = Date.new(y, 7, 23) cnt += 1 if d.wday == origin_wday end cnt end end puts Yukicoder.new.run