import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int[] dp = new int[41]; dp[0] = 1; for (int i = 0; i < n; i++) { int weight = sc.nextInt(); for (int j = 40; j >= weight; j--) { dp[j] += dp[j - weight]; } } System.out.println(dp[40]); } }