function gcd(a,b){while(b)[a,b]=[b,a%b];return a};
console.log(function(args){
  const tmp = args.trim().split('\n')
  const N = tmp[0]|0;
  const A = tmp[1].split(' ').map(v=>v|0).sort((a,b)=>b-a);
  let AA = 1, count = 0;
  for ( let i = 0; i < N-1; i++ ) {
    AA *= A[i];
    if ( AA % A[i+1] ) count++;
    else AA = AA * A[i] / gcd( AA, A[i] );
  }
  return count.toString();
}(require('fs').readFileSync('/dev/stdin', 'utf8')));