import 'dart:collection';
import 'dart:io';
import 'dart:math';

class Input{
  Iterator _iterator;

  int get getInt => int.parse(_getNext());
  double get getDouble => double.parse(_getNext());
  String get getStr => _getNext();

  String _getNext(){
    if(_iterator == null || !_iterator.moveNext()){
      _iterator = stdin.readLineSync().split(' ').iterator;
      _iterator.moveNext();
    }
    return _iterator.current;
  }
}

class Task{
  final input = Input();

  void solve(){
    const int MX = 1000 * 1000;
    var N = input.getInt;
    var flag = List<bool>.generate(MX+1, (index) => false);
    final map = SplayTreeMap<int, int>();
    for (var i = 0; i < N; i++) {
      int a = input.getInt;
      if(map.containsKey(a)) map[a]++;
      else map[a] = 1;
    }
    int ans = 0;
    map.forEach((key, value) {
      if(!flag[key]){
        for(var j=2*key;j<=MX;j+=key) flag[j] = true;
        if(value==1) ++ans;
      }
    });
    print(ans);
  }
}

void main(){
  var solver = Task();
  solver.solve();
}