#include <iostream>
#include <vector>

using namespace std;

int a;
int num;
vector<int> vct;

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

int threediv() {
    int result = 0;

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

    return result;
}

int main()
{
    cin >> a;
    int nums[a];

    for(int i = 0; i < a; i++) {
        cin >> num;
        vct.push_back(num);
    }
    resort(nums);
    cout << threediv() << endl;
    return 0;
}
