import java.util.*;
import java.text.*;
import java.math.*;
public class Main{
public static void main(String[] args){
Scanner scan = new Scanner(System.in);
int n = scan.nextInt();
Set<Integer> set = new HashSet<>();
set.add(scan.nextInt());
List<Integer> list;
int a;
while(n > 1){
a = scan.nextInt();
list = new ArrayList<>(set);
for(Integer i : list){
if(i != a){
set.add(Math.abs(i-a));
}
set.add(i+a);
}
set.add(a);
n--;
}
System.out.print(set.size());
}
}