using System;
using System.Collections.Generic;
using System.Linq;
class Program
{
    static string InputPattern = "Input1";
    static List<string> GetInputList()
    {
        var WillReturn = new List<string>();
        if (InputPattern == "Input1") {
            WillReturn.Add("3");
            WillReturn.Add("2 3 5");
            //7
            //0,2,3,5,7,8,10の7通りの得点が考えられる
        }
        else if (InputPattern == "Input2") {
            WillReturn.Add("10");
            WillReturn.Add("1 1 1 1 1 1 1 1 1 1");
            //11
            //0,1,2,3,4,5,6,7,8,9,10の11通りの得点が考えられる
        }
        else {
            string wkStr;
            while ((wkStr = Console.ReadLine()) != null) WillReturn.Add(wkStr);
        }
        return WillReturn;
    }
    static void Main()
    {
        List<string> InputList = GetInputList();
        int[] PArr = InputList[1].Split(' ').Select(X => int.Parse(X)).ToArray();
        int ScoreSum = PArr.Sum();
        // 作成可否[配点合計]なDP表
        bool[] CanCreateArr = new bool[ScoreSum + 1];
        CanCreateArr[0] = true;
        foreach (int EachInt in PArr) {
            // 01ナップサックなのでリバースループ
            for (int I = CanCreateArr.GetUpperBound(0); 0 <= I; I--) {
                if (CanCreateArr[I] == false) continue;
                CanCreateArr[I + EachInt] = true;
            }
        }
        Console.WriteLine(CanCreateArr.Count(X => X));
    }
}