gets
a = gets.split.map(&:to_i)
*lhs, rhs = *a
dp = Array.new(lhs.count).map{Array.new(21, 0)}
lhs.each_with_index do |n, i|
	if i == 0
		dp[i][lhs[i]] = 1
	else
		(0..20).each do |j|
			unless dp[i - 1][j] == 0
				l = j + lhs[i]
				m = j - lhs[i]
				dp[i][l] += dp[i - 1][j] if l <= 20
				dp[i][m] += dp[i - 1][j] if m >= 0
			end
		end
	end
end
p dp[lhs.count - 1][rhs]