sum=Array.new() ans=0 i=0,j=0,k=0,l=0 for i in 1..31 do sum.push("#{i}".chars[0].to_i+"#{i}".chars[1].to_i) end day31=[1,3,5,7,8,10,12] day30=[4,6,9,11] day28=[2] for l in day31 do ans+=sum.count(l) end for j in day30 do ans+=sum.first(30).count(j) end for k in day28 do ans+=sum.first(28).count(k) end puts ans