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

int n;
int f[1000010];
int g[1000010];

int main( int argc, char *argv[] )
{
    int a;

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

    for( int i=2; i<=1000000; i++ ) {
        if( f[i] == 0 ) continue;
        int k = i * 2;
        while( k <= 1000001 ) {
            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 );
}
