#!/usr/bin/ruby
# coding: utf-8

PI = Math.acos(-1)

n = gets.to_i
c = Array.new 21, 0
d = Array.new 21, 0

xs = gets.chomp.split(' ').map {|x| x.to_i}

c[xs[0]] = 1

(n-2).times do |i|
  x = xs[i+1]
  (21).times do |k|
    d[k + x] += c[k] if k+x < 21
    d[k - x] += c[k] if k-x > -1
  end
  (21).times do |k|
    c[k] = d[k]
    d[k] = 0
  end
end

puts c[xs[n-1]]