#include <stdio.h>
#include <stdlib.h>

int n;
int a[200001];
int f[1000000];
int g[1000000];

int comp( const void *a, const void *b ) {
    return( *((int *)b) - *((int *)a) );
}

int main( int argc, char *argv[] )
{
    scanf( "%d", &n );
    for( int i=0; i<n; i++ ) {
        scanf( "%d", &a[i] );
        if( f[a[i]] ) g[a[i]] = 1;
        f[a[i]] = 1;
    }

    qsort( a, n, sizeof(int), comp );

    for( int i=2; i<1000000; i++ ) {
        if( f[i] == 0 ) continue;
        int k = i * 2;
        while( k < 1000000 ) {
            f[k] = 0;
            k += i;
        }
    }

    int count = 0;
    for( int i=0; i<1000000; i++ )
        if( f[i] && !g[i] ) count ++;

    printf( "%d\n", count );
}
