A=[2,3,5,7,11,13];B=[4,6,8,9,10,12] h=Hash.new(0) A.product(B).each{|x,y|h[x*y]+=1} K=gets.to_i p h[K]/36.0