N = gets.to_i K = gets.to_i M = 10**5 ans = (1..M).count { (K >= 1 ? (1..K).map {rand(4..6)}.inject(:+) : 0) + (K <= N - 1 ? (1..(N - K)).map {rand(1..6)}.inject(:+) : 0) > (1..N).map {rand(1..6)}.inject(:+)}.fdiv(M) puts ans