#include <iostream>

using namespace std;

void printOneDimensionalArray(unsigned int N, unsigned int arr[]){
    for (unsigned int i = 0; i < N; ++i)
    {
        cout << arr[i] << " ";
    }
    cout << endl;
}

int main(){
    unsigned int N = 0;
    cin >> N;
    
    unsigned int arr[N] = {0};
    for (unsigned int i=0; i < N; ++i){
        cin >> arr[i];
    }
    // unsigned int N = 7;
    // unsigned int arr[N] = {2, 1, 3, 10, 7, 30, 6};

    for (unsigned int i = 0; i < N; ++i)
    {
        for (unsigned int j = (i + 1); j < N; ++j)
        {
            if (arr[i] > arr[j])
            {
                int temp = arr[i];
                arr[i] = arr[j];
                arr[j] = temp;
            }
        }
    }

    int res = 0;
    for (unsigned int i = 0; i < N; ++i)
    {
        for (unsigned int j = (i + 1); j < N; ++j)
        {
            // cout << "at i: " << arr[i] << "\tat j: " << arr[j] << endl;;
            if (arr[j] % arr[i] == 0)
            {
                for (unsigned int k = (j + 1); k < N; ++k)
                {
                    // cout << "at j: " << arr[j] << "\tat k: " << arr[k] << endl;;
                    if (arr[k] % arr[j] == 0)
                    {
                        res ++;   
                        // cout << "Now res is: " << res << endl;
                    }
                }
            }
        }
    }

    cout << res;

    // cout << "Sorted: ";
    // printOneDimensionalArray(N, arr);

    return 0;
}