import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        int[] arr1 = new int[20010];//这个用来读取数据
        Scanner sc = new Scanner(System.in);
        int x = sc.nextInt();
        int[] arr2 = new int[20010];//这个用来记录结果 重复的覆盖上去 
        int sum = 0;
        for (int i = 0; i < x; i++) {
            int temp = sc.nextInt();
            arr1[temp] = temp;//类似桶排序的保存方法
        }
        for (int i1 = 0; i1 < arr1.length; i1++) {
            for (int i2 = i1 + 1; i2 < arr1.length; i2++) {
                if (arr1[arr1[i1] + arr1[i2]] == arr1[i1] + arr1[i2] && arr1[i2] != 0 && arr1[i1] != 0) {
                    arr2[arr1[i1] + arr1[i2]] = arr1[i1] + arr1[i2];
                }
            }
        }
        for(int i=0;i<arr2.length;i++) {
            if(arr2[i]!=0) {
                sum++;
            }
        }
        System.out.println(sum);
    }
}