#include <stdio.h>

int a;
int num;

int i = 0;
int j = 0;
int k = 0;

void resort(int* nums) {
    for(j = 0; j < a; j++) {
        for(i = 1; i < a; i++) {
            if(nums[i-1] > nums[i]) {
                num = nums[i];
                nums[i] = nums[i-1];
                nums[i-1] = num;
            }
        }
    }

    i = 0;
    j = 0;
}

int threediv(int* vct) {
    int result = 0;

    for(k = 0; k < a; k++) {
        for(i = k+1; i < a; i++) {
            if(vct[i] % vct[k] == 0) {
                for(j = i+1; j < a; j++) {
                    if(vct[j] % vct[i] == 0) {
                        result++;
                    }
                }
            }
            else {
                continue;
            }
        }
    }

    i = 0;
    j = 0;
    k = 0;
    return result;
}

int main()
{
    scanf("%d", &a);
    int nums[a];

    for(int i = 0; i < a; i++) {
        scanf("%d", &num);
        nums[i] = num;
    }
    resort(nums);
    printf("%d\n", threediv(nums));
    return 0;
}