n = gets.strip.to_i s = "0" * 32 #print s sum = 0 cnt = 0 (0...31).to_a.combination(n) do |num| s2 = s.clone num.each do |i| s2[-i-1] = "1" end cnt += 1 #p s2 sum += s2.to_i(2) end print "#{cnt} #{sum}\n"