>>953 Ruby

gets.split(?,).each_cons(2).tap{|a| p 1.0 * a.count{|b| !b.uniq[1]}/ a.size}

# => 0.3333333333333333