N=gets.to_i m=[1.0,*[0]*6] N.times{|i|m=[0]+6.times.map{|j|m[i][j]*(6-j)/6+m[i][j+1]*-~j/6}} p m[6]