#include <stdio.h>

int main()
{
    int n, a[200010], check[1000010] = {0}, count = 0;
    scanf("%d", &n);
    for (int i = 0; i < n; i++)
    {
        scanf("%d", &a[i]);
    }

    for (int i = 0; i < n; i++)
    {
        if (check[a[i]] > 0)
        {
            check[a[i]] = 2;
            continue;
        }
        else
        {
            for (int j = a[i]; j <= 1000000; j += a[i])
                check[j]++;
        }
    }

    for (int i = 0; i < n; i++)
    {
        if (check[a[i]] == 1)
            count++;
    }

    // for (int i = 0; i < 30; i++)
    //     printf("%d %d\n", i, check[i]);

    printf("%d", count);
    return 0;
}