n = gets.chomp.to_i
line = gets.chomp
line = line.split(" ")
ary = Array.new(n){Array.new(21)}
for i in 0..20
  ary[0][i] = 0
end
ary[0][line[0].to_i] = 1;
for i in 1..n-1
  for j in 0..20
    if j-line[i].to_i >= 0 
      ary[i][j] = ary[i-1][j-line[i].to_i]
    else 
      ary[i][j] = 0
    end
    if j+line[i].to_i <= 20 
      ary[i][j] += ary[i-1][j+line[i].to_i]
    else 
      ary[i][j] += 0
    end
  end
end
puts ary[n-2][line[n-1].to_i]