import java.util.Scanner

object Main {
  def read() = {
    val sc = new Scanner(System.in)
    val n = sc.nextInt()
    val a = for (_ <- 0 until n) yield sc.nextInt()
    (n, a)
  }


  def solve(n: Int, a: IndexedSeq[Int]): Long = {
    val s = a.sum
    val dp1: Array[Array[Long]] = Array.fill(n + 1)(Array.fill(s + 1)(0))
    val dp23: Array[Array[Long]] = Array.fill(n + 1)(Array.fill(s / 2 + 1)(0))
    dp1(0)(0) + dp23(0)(0)
  }

  def main(args: Array[String]): Unit = {
    val (n, a) = read()
    println(solve(n, a))
  }

}