import java.io.*;
import java.util.*;

public class CF1141F {
	static class V {
		int l, r, a;
		V(int l, int r, int a) {
			this.l = l; this.r = r; this.a = a;
		}
	}
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		PrintWriter pw = new PrintWriter(System.out);
		int n = Integer.parseInt(br.readLine());
		StringTokenizer st = new StringTokenizer(br.readLine());
		int[] aa = new int[n + 1];
		for (int i = 1; i <= n; i++)
			aa[i] = Integer.parseInt(st.nextToken());
		for (int i = 1; i <= n; i++)
			aa[i] += aa[i - 1];
		int m = n * (n + 1) / 2;
		V[] vv = new V[m];
		m = 0;
		for (int i = 1; i <= n; i++)
			for (int j = i; j <= n; j++)
				vv[m++] = new V(i, j, aa[j] - aa[i - 1]);
		Arrays.sort(vv, (u, v) -> u.a != v.a ? u.a - v.a : u.r - v.r);
		int[] ii_ = new int[m];
		int[] ii = new int[m];
		int k_ = 0;
		for (int i = 0, j; i < m; i = j) {
			j = i + 1;
			while (j < m && vv[j].a == vv[i].a)
				j++;
			int k = 0, r = 0;
			for (int h = i; h < j; h++)
				if (vv[h].l > r) {
					ii[k++] = h;
					r = vv[h].r;
				}
			if (k_ < k) {
				k_ = k;
				int[] tmp = ii_; ii_ = ii; ii = tmp;
			}
		}
		pw.println(k_);
		for (int h = 0; h < k_; h++) {
			int i = ii_[h];
			pw.println(vv[i].l + " " + vv[i].r);
		}
		pw.close();
	}
}


import java.io.*;
import java.util.*;

public class ProblemF_2 {

    public static InputStream inputStream = System.in;

    public static OutputStream outputStream = System.out;

    public static void main(String[] args) {
        MyScanner scanner = new MyScanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);

        int n = scanner.nextInt();
        List<Integer> list = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            list.add(scanner.nextInt());
        }

        Map<Integer, List<Pair<Integer, Integer>>> map = new HashMap<>();
        for (int i = n - 1; i >= 0; i--) {
            int x = 0;
            for (int j = i; j >= 0; j--) {
                x = x + list.get(j);
                if (!map.containsKey(x)) {
                    map.put(x, new ArrayList<>());
                }
                map.get(x).add(new Pair<>(j + 1, i + 1));
            }
        }

        List<Pair<Integer, Integer>> ans = new ArrayList<>();
        for (Map.Entry<Integer, List<Pair<Integer, Integer>>> entry : map.entrySet()) {
            List<Pair<Integer, Integer>> segments = entry.getValue();
            Collections.reverse(segments);
            List<Pair<Integer, Integer>> result = new ArrayList<>();
            result.add(segments.get(0));
            for (int i = 1; i < segments.size(); i++) {
                if (segments.get(i).first > result.get(result.size() - 1).second) {
                    result.add(segments.get(i));
                }
            }
            if (result.size() > ans.size()) {
                ans = result;
            }
        }

        out.println(ans.size());
        for (Pair<Integer, Integer> pair : ans) {
            out.println(pair.first + " " + pair.second);
        }

        out.flush();
    }

    private static class MyScanner {
        private BufferedReader bufferedReader;
        private StringTokenizer stringTokenizer;

        private MyScanner(InputStream inputStream) {
            bufferedReader = new BufferedReader(new InputStreamReader(inputStream));
        }

        private String next() {
            while (stringTokenizer == null || !stringTokenizer.hasMoreElements()) {
                try {
                    stringTokenizer = new StringTokenizer(bufferedReader.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return stringTokenizer.nextToken();
        }

        private int nextInt() {
            return Integer.parseInt(next());
        }

        private long nextLong() {
            return Long.parseLong(next());
        }

        private double nextDouble() {
            return Double.parseDouble(next());
        }

        private String nextLine() {
            String str = "";
            try {
                str = bufferedReader.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }

    private static class Pair<F, S> {

        private F first;

        private S second;

        public Pair() {}

        public Pair(F first, S second) {
            this.first = first;
            this.second = second;
        }
    }
}


import java.math.BigDecimal;
import java.math.MathContext;
import java.math.RoundingMode;
import java.nio.charset.Charset;
import java.util.*;

import static java.lang.System.gc;
import static java.lang.System.out;

public class Main {

    Scanner scanner = new Scanner(System.in);

    public static void main(String[] args) {
        new Main().solve();
    }

    void solve() {

        int n = scanner.nextInt();
        scanner.nextLine();
        String s1 = scanner.nextLine();
        String s2 = scanner.nextLine();

        int ans = 0;
        boolean a[] = new boolean[30];
        boolean b[] = new boolean[30];

        for (int i = 0; i < n; i++) {
            if (s1.charAt(i) != s2.charAt(i)) {
                ans ++;
                a[s1.charAt(i)  - 'a'] = true;
                b[s2.charAt(i)  - 'a'] = true;
            }
        }
        for (int i = 0; i < n; i++) {
            if (s1.charAt(i) != s2.charAt(i) && a[s2.charAt(i) - 'a'] && b[s1.charAt(i) - 'a']) {
                for (int j = i + 1; j < n; j ++) {
                    if (s1.charAt(i) == s2.charAt(j) && s1.charAt(j) == s2.charAt(i)) {
                        out.println(ans - 2);
                        out.println((i + 1) + " " + (j + 1));
                        return;
                    }
                }
            }
        }

        for (int i = 0; i < n; i++) {
            if (s1.charAt(i) != s2.charAt(i) && (a[s2.charAt(i) - 'a'] || b[s1.charAt(i) - 'a'])) {
                for (int j = i + 1; j < n; j ++) {
                    if (s1.charAt(j) != s2.charAt(j) && (s1.charAt(i) == s2.charAt(j) || s1.charAt(j) == s2.charAt(i))) {
                        out.println(ans - 1);
                        out.println((i + 1) + " " + (j + 1));
                        return;
                    }
                }
            }
        }

        out.println(ans);
        out.println(-1 + " " + -1);
    }
}


import javax.print.attribute.standard.RequestingUserName;
import java.io.*;
import java.util.*;

public class Main {

    public static void main(String[] args) throws NumberFormatException, IOException
    {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Task solver = new Task();
        int tc = in.nextInt();
        for(int i = 0; i < tc; i++)
            solver.solve(i, in, out);
        out.close();
    }

    static class Task {

        public void solve(int testNumber, InputReader in, PrintWriter out) {

            int k = in.nextInt();
            int[] s = getArray(in.nextToken());
            int[] a = getArray(in.nextToken());
            int[] b = getArray(in.nextToken());

            int[] per = new int[k];
            boolean[] used = new boolean[k];
            Arrays.fill(per , -1);

            if(!check(s , a, per.clone(), k, used)){
                out.println("NO");
                return;
            }

            for(int i = 0; i < s.length; i++){
                if(per[s[i]] != -1){
                    continue;
                }
                for(int j = 0; j < k; j++){
                    if(used[j]){
                        continue;
                    }
                    per[s[i]] = j;
                    used[j] = true;
                    if(check(s , a , per.clone() , k, used)){
                        break;
                    }
                    per[s[i]] = -1;
                    used[j] = false;
                }
            }

            for(int i = 0; i < s.length; i++){
                if(per[s[i]] == -1){
                    out.println("NO");
                    return;
                }
                s[i] = per[s[i]];
            }

            if(cmp(s , b) > 0){
                out.println("NO");
                return;
            }

            int last = 0;
            for(int i = 0; i < k; i++){
                if(per[i] == -1) {
                    while(used[last])last++;
                    per[i] = last;
                    used[last] = true;
                }
            }

            char[] result = new char[k];

            for(int i = 0; i < k; i++){
                result[i] = (char)('a' + per[i]);
            }
            out.println("YES");
            out.println(new String(result));
        }

        private int cmp(int[] a, int[] b){
            for(int i = 0; i < a.length; i++){
                if(a[i] != b[i]){
                    return a[i] < b[i] ? -1 : 1;
                }
            }
            return 0;
        }

        private boolean check(int[] s, int[] a, int[] per, int k, boolean[] used) {
            int res[] = new int[s.length];
            int last = k - 1;
            for(int i = 0; i < res.length; ++i){

                if(per[s[i]] == -1){

                    while(last >= 0 && used[last]){
                        last--;
                    }

                    if(last < 0){
                        return false;
                    }

                    per[s[i]] = last;
                    last--;
                }
                res[i] = per[s[i]];
            }
            return cmp(a , res) <= 0;
        }

        private int[] getArray(String nextToken) {
            int result[] = new int[nextToken.length()];
            for(int i = 0; i < nextToken.length(); i++){
                result[i] = nextToken.charAt(i) - 'a';
            }
            return result;
        }
    }

    static class InputReader {

        BufferedReader in;
        StringTokenizer tok;

        public InputReader(InputStream stream){
            in = new BufferedReader(new InputStreamReader(stream), 32768);
            tok = null;
        }

        String nextToken()
        {
            String line = "";
            while(tok == null || !tok.hasMoreTokens()) {
                try {
                    if((line = in.readLine()) != null)
                        tok = new StringTokenizer(line);
                    else
                        return null;
                } catch (IOException e) {
                    e.printStackTrace();
                    return null;
                }
            }
            return tok.nextToken();
        }
        int nextInt(){
            return Integer.parseInt(nextToken());
        }
        long nextLong()	{
            return Long.parseLong(nextToken());
        }
        double nextDouble()	{
            return Double.parseDouble(nextToken());
        }

    }

}


import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.Map;

/**
 * Built using CHelper plug-in Actual solution is at the top
 */
public class Practice {

    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskA solver = new TaskA();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskA {

        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            String[] arr1 = new String[n];
            String[] arr2 = new String[n];
            for (int i = 0; i < n; i++) {
                arr1[i] = in.next();
            }
            for (int i = 0; i < n; i++) {
                arr2[i] = in.next();
            }
            int ans = 0;
            boolean arr[]=new boolean[n];
            boolean found=false;
            for (int i = 0; i < arr1.length; i++) {
                for(int j=0;j<arr1.length;j++){
                    found=false;
                    if(arr1[i].equals(arr2[j]) && !arr[j]){
                        found=true;
                        arr[j]=true;
                        break;
                    }
                }
                if(!found){
                    ans++;
                }
            }
            out.println(ans);
        }
    }

    public static boolean checkPrime(int n, int p) {
        for (int i = 2; i <= Math.sqrt(n) && i <= p; i++) {
            if (n % i == 0) {
                return false;
            }
        }
        return true;
    }

    public static void mergeArrays(int[] arr1, int[] arr2, int n1,
            int n2, int[] arr3) {
        int i = 0, j = 0, k = 0;
        while (i < n1 && j < n2) {
            if (arr1[i] < arr2[j]) {
                arr3[k++] = arr1[i++];
            } else {
                arr3[k++] = arr2[j++];
            }
        }
        while (i < n1) {
            arr3[k++] = arr1[i++];
        }
        while (j < n2) {
            arr3[k++] = arr2[j++];
        }
    }

    public long GCD(long a, long b) {
        if (b == 0) {
            return a;
        }
        return GCD(b, a % b);
    }

    public static long nCr(int n, int r) {
        return n * (n - 1) / 2;
    }

    static class InputReader {

        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }

    }

}


import java.io.BufferedOutputStream;
import java.io.PrintWriter;
import java.util.*;

public class E1180D {

    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        PrintWriter pw = new PrintWriter(new BufferedOutputStream(System.out));
        int n = sc.nextInt();
        int m = sc.nextInt();

        // Move from both ends, Time limit exceeded on test 6
        for (int i= 1; i<= m/2; i++) {
            // String s = "";
            int i2 = m -i + 1; // the other end of i
            // i is left row, i2 is right row
            for (int j = 1; j <= n ; j++) {
                int j2 = n - j + 1;
                // start with (i,j), then go thru all the cell with (,i) and (,i2)
                pw.println(j + " " + i);
                pw.println(j2+ " " + i2);
                // s += j + " " + i + "\n" + j2+ " " + i2 + "\n";
            }
            // out.print(s);
        }

        // if n is odd, there is one line in the middle
        if (m % 2 == 1) {
            int i2 = m /2 + 1; // this is the middle column
            for (int j = 1; j <= n/2 ; j++) {
                int j2 = n - j + 1;
                // start with (i,j), then go thru all the cell with (,i) and (,i2)
                pw.println(j + " " + i2);
                pw.println(j2+ " " + i2);
            }
            if (n %2 == 1) {
                int j = n /2 + 1;
                pw.println(j + " " + i2);
            }
        }
        pw.flush();
        pw.close();
    }
}


import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.HashSet;
import java.util.List;
import java.util.StringTokenizer;

public class D {

    int[][] fast(int n, int m){

        int[][] ans = new int[2][n * m];
        int c = 0;

        for (int left = 1, right = m; left < right; left++, right--) {
            for (int l = 1, r = n; l <= n && r >= 1; l++, r--) {
                ans[0][c] = l;
                ans[1][c++] = left;

                ans[0][c] = r;
                ans[1][c++] = right;
            }
        }

        if (m % 2 == 1) {
            int x = m/2 + 1;
            for(int l = 1, r = n;l < r;l++, r--){
                ans[0][c] = l;
                ans[1][c++] = x;

                ans[0][c] = r;
                ans[1][c++] = x;
                    if(n % 2 == 1 && l + 2 == r){
                        ans[0][c] = l+1;
                        ans[1][c++] = x;
                    }
            }
        }

        if(n == 1 && m % 2 == 1){
            ans[0][c] = 1;
            ans[1][c] = m/2 + 1;
        }

        return ans;
    }

    void stress(){

        for(int i = 3;i<=5;i++){
            for(int j = 2;j<=5;j++){
                int[][] ans = new int[2][];
                try{
                    ans = fast(i, j);
                }catch(Exception e){
                    out.println("ошибка");
                    out.print(i + " " + j);
                    return;
                }

                boolean[][] check = new boolean[i][j];
                for(int c = 0;c<ans[0].length;c++){
                    int x = ans[0][c] - 1;
                    int y = ans[1][c] - 1;
                    check[x][y] = true;
                }

                for(int c = 0;c<i;c++){
                    for(int q = 0;q<j;q++){
                        if(!check[c][q]){
                            out.println(i + " " + j);
                            out.println("точки");
                            for(int w = 0;w<ans[0].length;w++){
                                out.println(ans[0][w] + " " + ans[1][w]);
                            }
                            return;
                        }
                    }
                }

                HashSet<String> set = new HashSet<>();
                for(int c = 1;c<ans[0].length;c++){
                    int x = ans[0][c] - ans[0][c- 1];
                    int y = ans[1][c] - ans[1][c - 1];
                    set.add(x + " " + y);
                }

                if(set.size() < i * j - 1){
                    out.println(i + " " + j);
                    out.println("вектора");
                    for(int w = 0;w<ans[0].length;w++){
                        out.println(ans[0][w] + " " + ans[1][w]);
                    }
                    return;
                }
            }
        }
    }

    void normal(){
        int n =readInt();
        int m = readInt();
        int[][] ans = fast(n, m);
        for(int i = 0;i<ans[0].length;i++){
            out.println(ans[0][i] + " " + ans[1][i]);
        }
    }

    boolean stress = false;
    void solve(){
        if(stress) stress();
        else normal();
    }

    public static void main(String[] args) {
        new D().run();
    }

    void run(){
        init();
        solve();
        out.close();
    }

    BufferedReader in;
    PrintWriter out;

    StringTokenizer tok = new StringTokenizer("");

    void init(){
        in = new BufferedReader(new InputStreamReader(System.in));
        out  = new PrintWriter(System.out);
    }

    String readLine(){
        try{
            return in.readLine();
        }catch(Exception ex){
            throw new RuntimeException(ex);
        }
    }
    String readString(){
        while(!tok.hasMoreTokens()){
            String nextLine = readLine();
            if(nextLine == null) return null;
            tok = new StringTokenizer(nextLine);
        }
        return tok.nextToken();
    }

    int readInt(){
        return Integer.parseInt(readString());
    }

    long readLong(){
        return Long.parseLong(readString());
    }

    double readDouble(){
        return Double.parseDouble(readString());
    }
}


import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class D {

    private void solve() {
        br = new BufferedReader(new InputStreamReader(System.in));
        out = new PrintWriter(System.out);

        int n = nextInt(), m = nextInt();
        boolean[][] used = new boolean[n + 1][m + 1];

        for (int j = 1; j <= (m + 1) / 2; j++) {
            int x1 = 1, x2 = n;
            for (int i = 1; i <= n; i++) {
                if (x1 <= n && !used[x1][j]) {
                    out.println(x1 + " " + j);
                    used[x1++][j] = true;
                }
                if (x2 > 0 && !used[x2][m - j + 1]) {
                    out.println(x2 + " " + (m - j + 1));
                    used[x2--][m - j + 1] = true;
                }
            }
        }

        out.close();
    }

    public static void main(String[] args) {
        new D().solve();
    }

    private BufferedReader br;
    private StringTokenizer st;
    private PrintWriter out;

    private String next() {
        while (st == null || !st.hasMoreTokens()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
        }
        return st.nextToken();
    }

    private int nextInt() {
        return Integer.parseInt(next());
    }

    private long nextLong() {
        return Long.parseLong(next());
    }

    private double nextDouble() {
        return Double.parseDouble(next());
    }
}


import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class D {

    private void solve() {
        br = new BufferedReader(new InputStreamReader(System.in));
        out = new PrintWriter(System.out);

        int n = nextInt(), m = nextInt(), u = 1, d = n;

        while (u < d) {
            for (int i = 1; i <= m; i++) {
                out.println(u + " " + i);
                out.println(d + " " + (m - i + 1));
            }
            u++;
            d--;
        }
        if (u == d) {
            int l = 1, r = m;
            while (l < r) {
                out.println(u + " " + l++);
                out.println(d + " " + r--);
            }
            if (l == r) out.println(u + " " + l);
        }

        out.close();
    }

    public static void main(String[] args) {
        new D().solve();
    }

    private BufferedReader br;
    private StringTokenizer st;
    private PrintWriter out;

    private String next() {
        while (st == null || !st.hasMoreTokens()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
        }
        return st.nextToken();
    }

    private int nextInt() {
        return Integer.parseInt(next());
    }

    private long nextLong() {
        return Long.parseLong(next());
    }

    private double nextDouble() {
        return Double.parseDouble(next());
    }
}


import java.io.*;
import java.math.BigInteger;
import java.util.InputMismatchException;
import java.util.PriorityQueue;
import java.util.StringTokenizer;

public class D {
    static class FastWriter {
        private final BufferedWriter bw;

        public FastWriter() {
            this.bw = new BufferedWriter(new OutputStreamWriter(System.out));
        }

        public void print(Object object) throws IOException {
            bw.append("" + object);
        }

        public void println(Object object) throws IOException {
            print(object);
            bw.append("\n");
        }

        public void close() throws IOException {
            bw.close();
        }
    }

    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }

        BigInteger nextBigInteger() {
            try {
                return new BigInteger(nextLine());
            } catch (NumberFormatException e) {
                throw new InputMismatchException();
            }
        }
    }

    public static void main(String[] args) throws IOException {
        FastReader fr = new FastReader();
        FastWriter fw = new FastWriter();
        int n = fr.nextInt();
        int m = fr.nextInt();
        for (int r = 0; r < n / 2; r++) {
            for (int c = 0; c < m; c++) {
                fw.println((r + 1) + " " + (c + 1));
                fw.println((n - r) + " " + (m - c));
            }
        }
        if (n % 2 != 0) {
            int r = n / 2;
            for (int c = 0; c < m / 2; c++) {
                fw.println((r + 1) + " " + (c + 1));
                fw.println((r + 1) + " " + (m - c));
            }
            if (m % 2 != 0) fw.println((r + 1) + " " + (m / 2 + 1));
        }
        fw.close();
    }
}


import java.util.*;

import java.lang.*;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.*;

public class Main {

    public static void main(String[] args) throws Exception{
        FastReader sc=new FastReader();
        OutputStream outputStream = System.out;
        PrintWriter out = new PrintWriter(outputStream);
        int n=sc.nextInt();
        int[] font=new int[n];
        int[] cost=new int[n];
        for(int i=0;i<n;i++) {
            font[i]=sc.nextInt();

        }
        for(int i=0;i<n;i++) {
            cost[i]=sc.nextInt();
        }
        int[] dou= new int[n];
        for(int i=0;i<n;i++) {
            int min=Integer.MAX_VALUE;
            for(int j=0;j<i;j++) {
                if(font[j]<font[i]) {
                    if(min>cost[i]+cost[j]) {
                        min=cost[i]+cost[j];
                    }
                }
            }
            dou[i]=min;
        }
        int ans=Integer.MAX_VALUE;
        for(int i=0;i<n;i++) {
            int min=Integer.MAX_VALUE;
            for(int j=0;j<i;j++) {
                if(dou[j]!=Integer.MAX_VALUE && font[j]<font[i]) {
                    if(min>dou[j]+cost[i]) {
                        min=dou[j]+cost[i];
                    }
                }
            }
            if(min<ans) {
                ans=min;
            }
        }
        if(ans==Integer.MAX_VALUE) {
            System.out.println(-1);
        }
        else {
            System.out.println(ans);
        }
    }
}

class FastReader
{
    BufferedReader br;
    StringTokenizer st;

    public FastReader()
    {
        br = new BufferedReader(new
                 InputStreamReader(System.in));
    }

    String next()
    {
        while (st == null || !st.hasMoreElements())
        {
            try
            {
                st = new StringTokenizer(br.readLine());
            }
            catch (IOException  e)
            {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    int nextInt()
    {
        return Integer.parseInt(next());
    }

    long nextLong()
    {
        return Long.parseLong(next());
    }

    double nextDouble()
    {
        return Double.parseDouble(next());
    }

    String nextLine()
    {
        String str = "";
        try
        {
            str = br.readLine();
        }
        catch (IOException e)
        {
            e.printStackTrace();
        }
        return str;
    }
}


import java.io.*;
import java.lang.*;
public class CF1003E{
    public static void main(String args[]) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String[] s = br.readLine().split(" ");
        int n = Integer.parseInt(s[0]);
        int d = Integer.parseInt(s[1]);
        int k = Integer.parseInt(s[2]);
        StringBuffer sb = new StringBuffer();
        int[] rem = new int[n];
        int[] deg = new int[n];
        int i = 0;
        if(k == 1){
            if(n <= 2){

            }else{
                System.out.println("NO");
                return;
            }
        }
        for(i=0;i<d;i++){
            if(i>=n-1){
                System.out.println("NO");
                return;
            }
            sb.append((i+1) +" " + (i+2)+"\n");
            rem[i] = Math.min(i, d-i);
            deg[i]++;
            if(i+1<n)
            deg[i+1]++;
        }
        if(i<n){
            rem[i] = 0;
            deg[i] = 1;
        }
        i++;
        int j  = 0;
        for(;i<n;i++){
            //For all remaining Nodes
            while(true){
                if(j>=n){
                    System.out.println("NO");
                    return;
                }
                if(rem[j] > 0 && deg[j]<k){
                    deg[j]++;
                    rem[i] = rem[j] - 1;
                    sb.append((j+1)+" "+(i+1)+"\n");
                    deg[i]++;
                    break;
                }else{
                    j++;
                }
            }
        }
        System.out.println("YES");
        System.out.println(sb);
    }
}


/**
 * Created at 22:05 on 2019-09-14
 */

import java.io.*;
import java.util.*;

public class Main {

  static FastScanner sc = new FastScanner();
  static Output out = new Output(System.out);

  static final int[] dx = {0, 1, 0, -1};
  static final int[] dy = {-1, 0, 1, 0};

  static final long MOD = (long) (1e9 + 7);
  static final long INF = Long.MAX_VALUE / 2;

  static final int e5 = (int) 1e5;

  public static class Solver {
    public Solver() {

      int N = sc.nextInt();

      boolean[] flag = new boolean[101];
      for (int i=0; i<N; i++) {
        flag[sc.nextInt()] = true;
      }

      int ans = 0;
      for (int i=1; i<=100; i++) {
        if (flag[i]) {
          ans++;
          for (int j=i*2; j<=100; j+=i) {
            flag[j] = false;
          }
        }
      }

      out.println(ans);

    }

    public static void sort(int[] a) {
      shuffle(a);
      Arrays.sort(a);
    }

    public static void sort(long[] a) {
      shuffle(a);
      Arrays.sort(a);
    }

    public static void shuffle(int[] arr){
      int n = arr.length;
      Random rnd = new Random();
      for(int i=0; i<n; ++i){
        int tmp = arr[i];
        int randomPos = i + rnd.nextInt(n-i);
        arr[i] = arr[randomPos];
        arr[randomPos] = tmp;
      }
    }

    public static void shuffle(long[] arr){
      int n = arr.length;
      Random rnd = new Random();
      for(int i=0; i<n; ++i){
        long tmp = arr[i];
        int randomPos = i + rnd.nextInt(n-i);
        arr[i] = arr[randomPos];
        arr[randomPos] = tmp;
      }
    }
  }

  public static void main(String[] args) {
    new Solver();
    out.flush();
  }

  static class FastScanner {
    private InputStream in = System.in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;

    public void load() {
      try {
        in = new FileInputStream(next());
      } catch (Exception e) {
        e.printStackTrace();
      }
    }

    private boolean hasNextByte() {
      if (ptr < buflen) {
        return true;
      } else {
        ptr = 0;
        try {
          buflen = in.read(buffer);
        } catch (IOException e) {
          e.printStackTrace();
        }
        if (buflen <= 0) {
          return false;
        }
      }
      return true;
    }

    private int readByte() {
      if (hasNextByte()) return buffer[ptr++];
      else return -1;
    }

    private static boolean isPrintableChar(int c) {
      return 33 <= c && c <= 126;
    }

    private void skipUnprintable() {
      while (hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;
    }

    public boolean hasNext() {
      skipUnprintable();
      return hasNextByte();
    }

    public String next() {
      if (!hasNext()) throw new NoSuchElementException();
      StringBuilder sb = new StringBuilder();
      int b = readByte();
      while (isPrintableChar(b)) {
        sb.appendCodePoint(b);
        b = readByte();
      }
      return sb.toString();
    }

    public long nextLong() {
      if (!hasNext()) throw new NoSuchElementException();
      long n = 0;
      boolean minus = false;
      int b = readByte();
      if (b == '-') {
        minus = true;
        b = readByte();
      }
      if (b < '0' || '9' < b) {
        throw new NumberFormatException();
      }
      while (true) {
        if ('0' <= b && b <= '9') {
          n *= 10;
          n += b - '0';
        } else if (b == -1 || !isPrintableChar(b)) {
          return minus ? -n : n;
        } else {
          throw new NumberFormatException();
        }
        b = readByte();
      }
    }

    public int nextInt() {
      return (int) nextLong();
    }

    public int[] nextIntArray(int N, boolean oneBased) {
      if (oneBased) {
        int[] array = new int[N + 1];
        for (int i = 1; i <= N; i++) {
          array[i] = sc.nextInt();
        }
        return array;
      } else {
        int[] array = new int[N];
        for (int i = 0; i < N; i++) {
          array[i] = sc.nextInt();
        }
        return array;
      }
    }

    public long[] nextLongArray(int N, boolean oneBased) {
      if (oneBased) {
        long[] array = new long[N + 1];
        for (int i = 1; i <= N; i++) {
          array[i] = sc.nextLong();
        }
        return array;
      } else {
        long[] array = new long[N];
        for (int i = 0; i < N; i++) {
          array[i] = sc.nextLong();
        }
        return array;
      }
    }
  }

  static class Output extends PrintWriter {

    private long startTime;

    public Output(PrintStream ps) {
      super(ps);
    }

    public void print(int[] a, String separator) {
      for (int i = 0; i < a.length; i++) {
        if (i == 0) print(a[i]);
        else print(separator + a[i]);
      }
      println();
    }

    public void print(long[] a, String separator) {
      for (int i = 0; i < a.length; i++) {
        if (i == 0) print(a[i]);
        else print(separator + a[i]);
      }
      println();
    }

    public void print(String[] a, String separator) {
      for (int i = 0; i < a.length; i++) {
        if (i == 0) print(a[i]);
        else print(separator + a[i]);
      }
      println();
    }

    public void print(ArrayList a, String separator) {
      for (int i = 0; i < a.size(); i++) {
        if (i == 0) print(a.get(i));
        else print(separator + a.get(i));
      }
      println();
    }

    public void start() {
      startTime = System.currentTimeMillis();
    }

    public void time(String s) {
      long time = System.currentTimeMillis() - startTime;
      println(s + "(" + time + ")");
    }

  }

}


import java.io.BufferedWriter;
import java.io.DataInputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Arrays;

public class A {

	public static void main(String[] args) throws Exception {
		FastScanner sc = new FastScanner(System.in);
		FastPrinter out = new FastPrinter(System.out);
		new A().run(sc, out);
		out.close();
	}

	public void run(FastScanner sc, FastPrinter out) throws Exception {
		int N = sc.nextInt();
		int[] arr = sc.nextIntArray(N);
		Arrays.sort(arr);
		boolean[] done = new boolean[N];
		int ans = 0;
		for (int i = 0; i < N; i++) {
			if (done[i]) continue;
			ans++;
			for (int j = i; j < N; j++) {
				if (arr[j] % arr[i] == 0) {
					done[j] = true;

				}
			}
		}
		out.println(ans);
	}

	public void shuffle(int[] arr) {
		for (int i = 0; i < arr.length; i++) {
			int r = (int) (Math.random() * arr.length);
			if (i != r) {
				arr[i] ^= arr[r];
				arr[r] ^= arr[i];
				arr[i] ^= arr[r];
			}
		}
	}

	static class FastScanner {
		final private int BUFFER_SIZE = 1 << 10;
		private DataInputStream din;
		private byte[] buffer;
		private int bufferPointer, bytesRead;

		public FastScanner() {
			this(System.in);
		}

		public FastScanner(InputStream stream) {
			din = new DataInputStream(stream);
			buffer = new byte[BUFFER_SIZE];
			bufferPointer = bytesRead = 0;
		}

		public FastScanner(String fileName) throws IOException {
			Path p = Paths.get(fileName);
			buffer = Files.readAllBytes(p);
			bytesRead = buffer.length;
		}

		int[] nextIntArray(int N) throws IOException {
			int[] arr = new int[N];
			for (int i = 0; i < N; i++) {
				arr[i] = nextInt();
			}
			return arr;
		}

		String nextLine() throws IOException {
			int c = read();
			while (c != -1 && isEndline(c))
				c = read();
			if (c == -1) {
				return null;
			}
			StringBuilder res = new StringBuilder();
			do {
				if (c >= 0) {
					res.appendCodePoint(c);
				}
				c = read();
			} while (!isEndline(c));
			return res.toString();
		}

		boolean isEndline(int c) {
			return c == '\n' || c == '\r' || c == -1;
		}

		String next() throws Exception {
			int c = readOutSpaces();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = read();
			} while (!isSpaceChar(c));
			return res.toString();
		}

		boolean isSpaceChar(int c) {
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}

		public int nextInt() throws IOException {
			int ret = 0;
			byte c = read();
			while (c <= ' ')
				c = read();
			boolean neg = (c == '-');
			if (neg) c = read();
			do {
				ret = ret * 10 + c - '0';
			} while ((c = read()) >= '0' && c <= '9');

			if (neg) return -ret;
			return ret;
		}

		public long nextLong() throws IOException {
			long ret = 0;
			byte c = read();
			while (c <= ' ')
				c = read();
			boolean neg = (c == '-');
			if (neg) c = read();
			do {
				ret = ret * 10 + c - '0';
			} while ((c = read()) >= '0' && c <= '9');
			if (neg) return -ret;
			return ret;
		}

		public double nextDouble() throws IOException {
			double ret = 0, div = 1;
			byte c = read();
			while (c <= ' ')
				c = read();
			boolean neg = (c == '-');
			if (neg) c = read();

			do {
				ret = ret * 10 + c - '0';
			} while ((c = read()) >= '0' && c <= '9');

			if (c == '.') {
				while ((c = read()) >= '0' && c <= '9') {
					ret += (c - '0') / (div *= 10);
				}
			}

			if (neg) return -ret;
			return ret;
		}

		private void fillBuffer() throws IOException {
			if (din == null) {
				bufferPointer = 0;
				bytesRead = -1;
			} else {
				bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
			}
			if (bytesRead == -1) buffer[0] = -1;
		}

		private byte read() throws IOException {
			if (bufferPointer == bytesRead) fillBuffer();
			return buffer[bufferPointer++];
		}

		private int readOutSpaces() throws IOException {
			while (true) {
				if (bufferPointer == bytesRead) fillBuffer();
				int c = buffer[bufferPointer++];
				if (!isSpaceChar(c)) {
					return c;
				}
			}
		}

		public void close() throws IOException {
			if (din == null) return;
			din.close();
		}

		public int[][] readGraph(int N, int M, boolean zeroIndexed, boolean bidirectional) throws Exception {
			int[][] adj = new int[N][];
			int[] numNodes = new int[N];
			int[][] input = new int[M][2];
			for (int i = 0; i < M; i++) {
				int a = nextInt();
				int b = nextInt();
				if (zeroIndexed) {
					a--;
					b--;
				}
				input[i][0] = a;
				input[i][1] = b;
				numNodes[a]++;
				if (bidirectional) numNodes[b]++;
			}
			for (int i = 0; i < N; i++) {
				adj[i] = new int[numNodes[i]];
				numNodes[i] = 0;
			}
			for (int i = 0; i < M; i++) {
				int a = input[i][0];
				int b = input[i][1];
				adj[a][numNodes[a]++] = b;
				if (bidirectional) adj[b][numNodes[b]++] = a;
			}
			return adj;
		}

		public int[][][] readWeightedGraph(int N, int M, boolean zeroIndexed, boolean bidirectional) throws Exception {
			int[][][] adj = new int[N][][];
			int[] numNodes = new int[N];
			int[][] input = new int[M][3];
			for (int i = 0; i < M; i++) {
				int a = nextInt();
				int b = nextInt();
				if (zeroIndexed) {
					a--;
					b--;
				}
				int d = nextInt();
				input[i][0] = a;
				input[i][1] = b;
				input[i][2] = d;
				numNodes[a]++;
				if (bidirectional) numNodes[b]++;
			}
			for (int i = 0; i < N; i++) {
				adj[i] = new int[numNodes[i]][2];
				numNodes[i] = 0;
			}
			for (int i = 0; i < M; i++) {
				int a = input[i][0];
				int b = input[i][1];
				int d = input[i][2];
				adj[a][numNodes[a]][0] = b;
				adj[a][numNodes[a]][1] = d;
				numNodes[a]++;
				if (bidirectional) {
					adj[b][numNodes[b]][0] = a;
					adj[b][numNodes[b]][1] = d;
					numNodes[b]++;
				}
			}
			return adj;
		}
	}

	static class FastPrinter {
		static final char ENDL = '\n';
		StringBuilder buf;
		PrintWriter pw;

		public FastPrinter(OutputStream stream) {
			buf = new StringBuilder();
			pw = new PrintWriter(new BufferedWriter(new OutputStreamWriter(stream)));
		}

		public FastPrinter(String fileName) throws Exception {
			buf = new StringBuilder();
			pw = new PrintWriter(new BufferedWriter(new FileWriter(fileName)));
		}

		public FastPrinter(StringBuilder buf) {
			this.buf = buf;
		}

		public void print(int a) {
			buf.append(a);
		}

		public void print(long a) {
			buf.append(a);
		}

		public void print(char a) {
			buf.append(a);
		}

		public void print(char[] a) {
			buf.append(a);
		}

		public void print(double a) {
			buf.append(a);
		}

		public void print(String a) {
			buf.append(a);
		}

		public void print(Object a) {
			buf.append(a.toString());
		}

		public void println() {
			buf.append(ENDL);
		}

		public void println(int a) {
			buf.append(a);
			buf.append(ENDL);
		}

		public void println(long a) {
			buf.append(a);
			buf.append(ENDL);
		}

		public void println(char a) {
			buf.append(a);
			buf.append(ENDL);
		}

		public void println(char[] a) {
			buf.append(a);
			buf.append(ENDL);
		}

		public void println(double a) {
			buf.append(a);
			buf.append(ENDL);
		}

		public void println(String a) {
			buf.append(a);
			buf.append(ENDL);
		}

		public void println(Object a) {
			buf.append(a.toString());
			buf.append(ENDL);
		}

		public void printf(String format, Object... args) {
			buf.append(String.format(format, args));
		}

		public void close() {
			pw.print(buf);
			pw.close();
		}

		public void flush() {
			pw.print(buf);
			pw.flush();
			buf.setLength(0);
		}

	}

}


import static java.lang.Integer.parseInt;
import static java.lang.Long.parseLong;
import static java.lang.System.exit;
import static java.util.Arrays.sort;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class A {

	static void solve() throws Exception {
		int n = scanInt();
		int a[] = new int[n];
		for (int i = 0; i < n; i++) {
			a[i] = scanInt();
		}
		sort(a);
		int ans = 0;
		ans: while (true) {
			for (int i = 0;; i++) {
				if (i == n) {
					break ans;
				}
				if (a[i] != 0) {
					++ans;
					int t = a[i];
					a[i] = 0;
					for (i++; i < n; i++) {
						if (a[i] % t == 0) {
							a[i] = 0;
						}
					}
					break;
				}
			}
		}
		out.print(ans);
	}

	static int scanInt() throws IOException {
		return parseInt(scanString());
	}

	static long scanLong() throws IOException {
		return parseLong(scanString());
	}

	static String scanString() throws IOException {
		while (tok == null || !tok.hasMoreTokens()) {
			tok = new StringTokenizer(in.readLine());
		}
		return tok.nextToken();
	}

	static BufferedReader in;
	static PrintWriter out;
	static StringTokenizer tok;

	public static void main(String[] args) {
		try {
			in = new BufferedReader(new InputStreamReader(System.in));
			out = new PrintWriter(System.out);
			solve();
			in.close();
			out.close();
		} catch (Throwable e) {
			e.printStackTrace();
			exit(1);
		}
	}
}


import java.io.*;
import java.util.*;
public class Main
{
	public static void main(String[] args) throws Exception
	{
	    BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
	    int n=Integer.parseInt(br.readLine());
	    String s=br.readLine();
	    String ss[]=s.split(" ");
	    int arr[]=new int[n];
	    for(int i=0;i<n;i++)
	    arr[i]=Integer.parseInt(ss[i]);
	    Arrays.sort(arr);
	    int coun=0,coun2=0;
	    for(int i=arr[0],k=0;k<n;)
	    {
	        for(int j=k;j<n;j++)
	        {
	            if(arr[j]%i==0)
	            {
	                arr[j]=-1;
	                coun2++;
	            }
	        }
	        Arrays.sort(arr);
	        k=coun2;
	        coun++;
	        if(coun2<n)
	        i=arr[coun2];
	        else
	        break;

	    }
		System.out.println(coun);
	}
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author null
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Input in = new Input(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskA solver = new TaskA();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskA {
        public void solve(int testNumber, Input in, PrintWriter out) {
            try {
                int n = in.readInt();
                int[] a = new int[n];
                for (int i = 0; i < n; i++) {
                    a[i] = in.readInt();
                }
                Arrays.sort(a);
                boolean[] b = new boolean[n];
                int ans = 0;
                while (true) {
                    int x = 0;
                    for (int i = 0; i < n; i++) {
                        if (!b[i] && x == 0) {
                            x = a[i];
                        }
                        if (x != 0 && a[i] % x == 0) {
                            b[i] = true;
                        }
                    }
                    if (x == 0) {
                        break;
                    }
                    ans++;
                }
                out.println(ans);
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
        }

    }

    static class Input {
        public final BufferedReader reader;
        private String line = "";
        private int pos = 0;

        public Input(InputStream inputStream) {
            reader = new BufferedReader(new InputStreamReader(inputStream));
        }

        private boolean isSpace(char ch) {
            return ch <= 32;
        }

        public String readWord() throws IOException {
            skip();
            int start = pos;
            while (pos < line.length() && !isSpace(line.charAt(pos))) {
                pos++;
            }
            return line.substring(start, pos);
        }

        public int readInt() throws IOException {
            return Integer.parseInt(readWord());
        }

        private void skip() throws IOException {
            while (true) {
                if (pos >= line.length()) {
                    line = reader.readLine();
                    pos = 0;
                }
                while (pos < line.length() && isSpace(line.charAt(pos))) {
                    pos++;
                }
                if (pos < line.length()) {
                    return;
                }
            }
        }

    }
}


import java.util.*;
import java.io.*;

public class Main {

	static Scanner console;
	public static void main(String[] args) {
		console = new Scanner(System.in);
		int n = console.nextInt();
		List<Integer> arr= new ArrayList<>();
		for(int i = 0; i < n; i++) arr.add( console.nextInt());
		Collections.sort(arr);
		List<Integer> groups = new ArrayList<>();
//		System.out.println(arr);
		for(int i = 0; i < arr.size() - 1; i++) {
			int j = i+1;
			groups.add(arr.get(i));
//			System.out.println(groups);
			while(j < arr.size()) {
//				System.out.println(j);
				if(arr.get(j) % arr.get(i) == 0) {
					arr.remove(j);

				}
				else {
//					groups.add(arr.get(j));
					j++;
				}
			}
		}
//		System.out.println(arr);
		System.out.println(arr.size());
	}
}


import java.io.BufferedReader;
import java.io.InputStreamReader;

import java.util.*;

// Warning: Printing unwanted or ill-formatted data to output will cause the test cases to fail

public class Ideone {
    public static void main(String args[] ) throws Exception{
       BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
       int n,i,j,k,temp ;
       n = ni(br.readLine());
       int[] a = nia(br);
       Arrays.sort(a);
       int c = 0;
       for( i = 0; i< n ; i++) {
    	   if(a[i] > 0) {
    		   c++;
    		   temp = a[i];
    		   for(j = i+1; j< n; j++) {
    			   if(a[j] % temp == 0)
    				    a[j] = 0;
    		   }
    	   }
       }

       System.out.println(c);

    }
    static Integer[] nIa(BufferedReader br) throws Exception{
        String sa[]=br.readLine().split(" ");
        Integer [] a = new Integer [sa.length];
        for(int i = 0; i< sa.length; i++){
            a[i]= ni(sa[i]);
        }
        return a;
   }
    static int[] nia(BufferedReader br) throws Exception{
        String sa[]=br.readLine().split(" ");
        int [] a = new int [sa.length];
        for(int i = 0; i< sa.length; i++){
            a[i]= ni(sa[i]);
        }
        return a;
   }

    static int ni(String s){
        return Integer.parseInt(s);
    }
    static float nf(String s){
        return Float.parseFloat(s);
    }
    static double nd(String s){
        return Double.parseDouble(s);
    }

}


import java.util.Arrays;
import java.util.Scanner;

public class problemA {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int[] numbs = new int[n];
        int[] smallest_color = new int[n];
        for(int i =  0; i < n;i++){
            numbs[i] = scan.nextInt();
        }
        Arrays.sort(numbs);
        int count = 0;
        for(int i =0; i < n; i++){
            for(int j=0; j <n;j++ ){
                if(smallest_color[j] == 0){
                    count++;
                    smallest_color[j] = numbs[i];
                    break;
                }
                if(numbs[i] % smallest_color[j] == 0){
                    break;
                }
            }
        }
        System.out.println(count);
    }
}


import java.util.*;
import java.lang.*;
import java.io.*;
//****Use Integer Wrapper Class for Arrays.sort()****
public class AG1 {
    public static void main(String[] Args){
        FastReader scan=new FastReader();
        int n=scan.nextInt();
        int[] arr=new int[n];
        for (int i = 0; i <n ; i++) {
            arr[i]=scan.nextInt();
        }
        Arrays.sort(arr);
        boolean[] done=new boolean[n];
        int ans=0;
        for(int i=0;i<n;i++){
            if(!done[i]){
                done[i]=true;
                ans++;
                for(int j=i+1;j<n;j++){
                    if(arr[j]%arr[i]==0){
                        done[j]=true;
                    }
                }
            }
        }
        System.out.println(ans);
    }
    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        public FastReader()
        {
            br = new BufferedReader(new
                    InputStreamReader(System.in));
        }

        String next()
        {
            while (st == null || !st.hasMoreElements())
            {
                try
                {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException  e)
                {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt()
        {
            return Integer.parseInt(next());
        }

        long nextLong()
        {
            return Long.parseLong(next());
        }

        double nextDouble()
        {
            return Double.parseDouble(next());
        }

        String nextLine()
        {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
        }
    }

}


import java.io.*;
import java.math.*;
import java.util.*;

public class Main {
	static final long MOD = 998244353;
	//static final long MOD = 1000000007;
	static boolean[] visited;
    public static void main(String[] args) throws IOException {
        FastScanner sc = new FastScanner();
        int N = sc.nextInt();
        int[] nums = new int[N];
        for (int i = 0; i < N; i++) {
        	nums[i] = sc.nextInt();
        }
        Arrays.sort(nums);
        boolean[] hit = new boolean[N];
        int colors = 0;
        int index = 0;
        while (index < N) {
        	if (hit[index] == false) {
        		colors++;
        		int div = nums[index];
        		for (int i = index; i < N; i++) {
        			if (nums[i] % div == 0) {
        				hit[i] = true;
        			}
        		}
        	}
        	index++;
        }
        System.out.println(colors);
    }

    public static int[][] sort(int[][] array) {
    	//Sort an array (immune to quicksort TLE)
		Random rgen = new Random();
		for (int i = 0; i< array.length; i++) {
		    int randomPosition = rgen.nextInt(array.length);
		    int[] temp = array[i];
		    array[i] = array[randomPosition];
		    array[randomPosition] = temp;
		}
		Arrays.sort(array, new Comparator<int[]>() {
			  @Override
			  public int compare(int[] arr1, int[] arr2) {
				  //Ascending order
				  if (arr1[0] != arr2[0])
					  return arr1[0]-arr2[0];
				  else
					  return arr2[1]-arr1[1];
			  }
		});
		return array;
	}

    static class FastScanner {
        BufferedReader br;
        StringTokenizer st;

        public FastScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException  e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }
}

class Node {
	public HashSet<Node> children;
	public int n;

	public Node(int n) {
		this.n = n;
		children = new HashSet<Node>();
	}

	public void addChild(Node node) {
		children.add(node);
	}

	public void removeChild(Node node) {
		children.remove(node);
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#hashCode()
	 */
	@Override
	public int hashCode() {
		return n;
	}

	@Override
	public boolean equals(Object obj) {
		if (! (obj instanceof Node)) {
			return false;
		} else {
			Node node = (Node) obj;
			return (n == node.n);
		}
	}

	public String toString() {
		return (this.n+1)+"";
	}
}


import java.util.*;

public class codea{
	public static void main(String args[])
	{
	  Scanner in = new Scanner(System.in);
	  int n = in.nextInt();
	  int arr[] = new int[n];
	  for(int i =0;i<n;i++)
	   arr[i]= in.nextInt();
	  Arrays.sort(arr);
	  int max =0;
	  boolean check[]= new boolean [n];
	  int count=0;
	  for(int i =0;i<n;i++)
	  {

	   if(!check[i])
	   {
	   	count++;

	   for(int j=i;j<n;j++)
	   {

	    if(arr[j]%arr[i]==0)
	     check[j]=true;
	   }

	   }
	  }
	  System.out.println(count);
	}
}


//package Round584;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;
public class typeA {
	public static void main(String[] args) {
		FastReader s = new FastReader();
		int n = s.nextInt();
		int[] arr = new int[n];
		for(int i=0;i<n;i++) {
			arr[i]=s.nextInt();
		}
		boolean[] arr2  = new boolean[n];
		Arrays.sort(arr);
		for(int i=0;i<arr2.length;i++) {
			arr2[i]=true;
		}
		//arr2[0]=true;
		for(int i=0;i<n-1;i++) {
			for(int j=i+1;j<n;j++) {
					if(arr[j]%arr[i]==0) {
						arr2[j]=false;
					}
				}
			}
		int count=0;
		for(int i=0;i<n;i++) {
			if(arr2[i]==true) {
				count++;
			}
		}
		System.out.println(count);
	}
	static class FastReader

    {
        BufferedReader br;
        StringTokenizer st;

        public FastReader()
        {
            br = new BufferedReader(new
                     InputStreamReader(System.in));
        }

        String next()
        {
            while (st == null || !st.hasMoreElements())
            {
                try
                {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException  e)
                {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt()
        {
            return Integer.parseInt(next());
        }

        long nextLong()
        {
            return Long.parseLong(next());
        }

        double nextDouble()
        {
            return Double.parseDouble(next());
        }

        String nextLine()
        {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
        }
    }

}


import java.lang.*;
import java.util.*;
import java.io.*;

public class Main {
    void solve() {
       int n=ni();
       int a[]=new int[n+1];
       for(int i=1;i<=n;i++) a[i]=ni();
       int vis[]=new int[101];
       int ans=0;
       Arrays.sort(a,1,n+1);
       for(int i=1;i<=n;i++){
           if(vis[a[i]]==1) continue;
           ans++;
           for(int j=a[i];j<=100;j+=a[i]) vis[j]=1;
       }
       pw.println(ans);
    }

    long M = (long)1e9+7;
    // END
    PrintWriter pw;
    StringTokenizer st;
    BufferedReader br;

    void run() throws Exception {
        br = new BufferedReader(new InputStreamReader(System.in));
        pw = new PrintWriter(System.out);
        long s = System.currentTimeMillis();
        solve();
        pw.flush();
    }
    public static void main(String[] args) throws Exception {
        new Main().run();
    }

    String ns() {
        while (st == null || !st.hasMoreElements()) {

            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    String nextLine() throws Exception {
        String str = "";
        try {
            str = br.readLine();
        } catch (IOException e) {
            throw new Exception(e.toString());
        }
        return str;
    }

    int ni() {
        return Integer.parseInt(ns());
    }

    long nl() {
        return Long.parseLong(ns());
    }

    double nd() {
        return Double.parseDouble(ns());
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class Main {
    static BufferedReader reader;
    static StringTokenizer tokenizer;
    static PrintWriter writer;

    static String nextToken() throws IOException {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            tokenizer = new StringTokenizer(reader.readLine());
        }
        return tokenizer.nextToken();
    }

    static int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }

    static void banana() throws IOException {
        int n = nextInt();
        int[] a = new int[n];
        int[] color = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = nextInt();
        }
        int c = 0;
        while(true) {
            int mn = 1000;
            for (int i = 0; i < n; i++) {
                if(color[i] == 0) {
                    mn = Math.min(mn, a[i]);
                }
            }
            if (mn == 1000) {
                break;
            }
            c++;
            for (int i = 0; i < n; i++) {
                if (color[i] == 0) {
                    if (a[i] % mn == 0) {
                        color[i] = c;
                    }
                }
            }
        }
        writer.println(c);
    }

    public static void main(String[] args) throws IOException {
        reader = new BufferedReader(new InputStreamReader(System.in));
        tokenizer = null;
        writer = new PrintWriter(System.out);
        banana();
        reader.close();
        writer.close();
    }
}


import java.io.*;
import java.lang.*;
import java.util.*;

public class Solver {
    public static void main(String[] args) {
        FastReader in = new FastReader();
        PrintWriter out = new PrintWriter(System.out);
        TaskC solver = new TaskC(in, out);
        solver.solve();
        out.close();
    }

    static class TaskC {
        FastReader in;
        PrintWriter out;

        public TaskC(FastReader in, PrintWriter out) {
            this.in = in;
            this.out = out;
        }

        public void solve() {
            solveA();
        }

        public void solveA() {
            int n = in.nextInt();
            int[] inputColors = in.nextIntArray(n);

            int colors = 0;

            Arrays.sort(inputColors);

            for (int i = 0; i < inputColors.length; i++) {
                if (inputColors[i] == -1) {
                    continue;
                }

                int colorCode = inputColors[i];
                boolean colorFound = false;
                for (int j = i; j < inputColors.length; j++) {
                    if (inputColors[j] != -1 && inputColors[j] % colorCode == 0) {
                        if (!colorFound) {
                            colorFound = true;
                            colors++;
                        }
                        inputColors[j] = -1;
                    }
                }
            }

            out.println(colors);
        }

        public void solveB() {

        }

        public void solveC() {

        }

        public void solveD() {

        }

        public void solveE() {

        }

        public void solveF() {

        }

        public void solveG() {

        }

        public void solveH() {

        }
    }

    private static long gcd(long a, long b) {
        if (a == 0) {
            return b;
        }
        return gcd(b % a, a);
    }

    private static long lcm(long a, long b) {
        return (a * b) / gcd(a, b);
    }

    private static int min(int a, int b) {
        return a < b ? a : b;
    }

    private static int max(int a, int b) {
        return a > b ? a : b;
    }

    private static int min(ArrayList<Integer> list) {
        int min = Integer.MAX_VALUE;
        for (int el : list) {
            if (el < min) {
                min = el;
            }
        }
        return min;
    }

    private static int max(ArrayList<Integer> list) {
        int max = Integer.MIN_VALUE;
        for (int el : list) {
            if (el > max) {
                max = el;
            }
        }
        return max;
    }

    private static int min(int[] list) {
        int min = Integer.MAX_VALUE;
        for (int el : list) {
            if (el < min) {
                min = el;
            }
        }
        return min;
    }

    private static int max(int[] list) {
        int max = Integer.MIN_VALUE;
        for (int el : list) {
            if (el > max) {
                max = el;
            }
        }
        return max;
    }

    private static void fill(int[] array, int value) {
        for (int i = 0; i < array.length; i++) {
            array[i] = value;
        }
    }

    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            br = new BufferedReader(new
                    InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }

        int[] nextIntArray(int n) {
            int[] array = new int[n];
            for (int i = 0; i < n; i++) {
                array[i] = nextInt();
            }
            return array;
        }
    }
}


import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.next());
        int[] a = new int[N];
        int[] flag = new int[N];
        int ans = 0;
        for (int i=0;i<N;i++) {
            a[i] = Integer.parseInt(sc.next());
        }
        Arrays.sort(a);
        for (int i=0;i<N;i++) {
            int used = 0;
            for (int j=0;j<N;j++) {
                if (flag[j]==1) {
                    continue;
                } else {
                    if (a[j]%a[i]==0) {
                        used=1;
                        flag[j]=1;
                    }
                }
            }
            if (used==1) {
                ans++;
            }
        }
        System.out.println(ans);
    }
}


import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Scanner;

public class a1 {

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int n = s.nextInt();
		int a[] = new int[n];
		HashMap<Integer,ArrayList<Integer>> h = new HashMap<>();
		boolean visited[] = new boolean[n];
		for(int i=0;i<n;i++)
		{
			a[i] = s.nextInt();

		}
		Arrays.sort(a);
		for(int i=0;i<n;i++) {
			if(h.containsKey(a[i])) {

							ArrayList<Integer> temp = h.get(a[i]);
							temp.add(i);
							h.put(a[i],temp);
						}
						else {
							ArrayList<Integer> k =new ArrayList<>();
							k.add(i);
							h.put(a[i], k);
						}
		}
		int ctr=0;
		for(int i=0;i<n;i++) {
			if(!visited[i]) {
				//System.out.println(a[i]);
				ctr++;
				for(int j=a[i];j<=100;j+=a[i]) {
					if(h.containsKey(j)) {
						ArrayList<Integer> m = h.get(j);
						for(int k=0;k<m.size();k++) {
							visited[m.get(k)]=true;
						}
						h.remove(j);
					}
				}
			}
		}
		System.out.println(ctr);
	}
}


import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.HashSet;

public class PTM {

    public static void main(String[] args) throws Exception {
        BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter printWriter = new PrintWriter(System.out);
        int N = Integer.parseInt(bufferedReader.readLine());
        String[] strings = bufferedReader.readLine().split(" ");
        int[] arr = new int[strings.length];
        HashSet<Integer> set = new HashSet<>();
        for (int i = 0; i < N; i++) {
            arr[i] = Integer.parseInt(strings[i]);
            set.add(arr[i]);
        }
        Arrays.sort(arr);
        int c = 0;
        for (int i = 0; i < N; i++) {
            int value = arr[i];
            if (!set.contains(value)) {
                continue;
            }
            for (int j = 1; j <= 100; j++) {
                if (set.contains(value * j)) {
                    set.remove(value * j);
                }
            }
            c++;
        }
        printWriter.println(c);
        printWriter.flush();
    }
}


import java.io.*;
import java.util.*;

public class A {
    FastScanner in;
    PrintWriter out;

    void solve() {
        int n = in.nextInt();
        int[] a = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = in.nextInt();
        }
        Arrays.sort(a);
        int res = 0;
        for (int i = 0; i < n; i++) {
            boolean ok = false;
            for (int j = 0; j < i; j++) {
                if (a[i] % a[j] == 0) {
                    ok = true;
                }
            }
            if (!ok) {
                res++;
            }
        }
        out.println(res);
    }

    void run() {
        try {
            in = new FastScanner(new File("A.in"));
            out = new PrintWriter(new File("A.out"));

            solve();

            out.close();
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }
    }

    void runIO() {

        in = new FastScanner(System.in);
        out = new PrintWriter(System.out);

        solve();

        out.close();
    }

    class FastScanner {
        BufferedReader br;
        StringTokenizer st;

        public FastScanner(File f) {
            try {
                br = new BufferedReader(new FileReader(f));
            } catch (FileNotFoundException e) {
                e.printStackTrace();
            }
        }

        public FastScanner(InputStream f) {
            br = new BufferedReader(new InputStreamReader(f));
        }

        String next() {
            while (st == null || !st.hasMoreTokens()) {
                String s = null;
                try {
                    s = br.readLine();
                } catch (IOException e) {
                    e.printStackTrace();
                }
                if (s == null)
                    return null;
                st = new StringTokenizer(s);
            }
            return st.nextToken();
        }

        boolean hasMoreTokens() {
            while (st == null || !st.hasMoreTokens()) {
                String s = null;
                try {
                    s = br.readLine();
                } catch (IOException e) {
                    e.printStackTrace();
                }
                if (s == null)
                    return false;
                st = new StringTokenizer(s);
            }
            return true;
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }
    }

    public static void main(String[] args) {
        new A().runIO();
    }
}


import java.io.*;
import java.util.*;
import java.math.*;

public class Dasha {
    static Scanner sc = new Scanner(System.in);
    static PrintWriter pw = new PrintWriter(System.out), pw2 = new PrintWriter(System.out);

    public static void main(String[] args) throws IOException {
        int n=sc.nextInt();
        int[] arr=new int[101];
        for(int i=0;i<n;i++)
            arr[sc.nextInt()]++;
        boolean [] vis=new boolean[101];
        int c=0;
        for(int i=1;i<=100;i++){
            if(!vis[i]&&arr[i]>0){
                c++;
                for(int j=i+i;j<=100;j+=i)
                    vis[j]=true;
            }
        }
        pw.println(c);
        pw.flush();
    }

    public static <E> void print2D(E[][] arr) {
        for (int i = 0; i < arr.length; i++) {
            for (int j = 0; j < arr[i].length; j++) {
                pw.println(arr[i][j]);
            }
        }
    }

    public static int digitSum(String s) {
        int toReturn = 0;
        for (int i = 0; i < s.length(); i++) toReturn += Integer.parseInt(s.charAt(i) + " ");
        return toReturn;
    }

    public static boolean isPrime(long n) {
        if (n <= 1)
            return false;
        if (n <= 3)
            return true;

        if (n % 2 == 0 || n % 3 == 0)
            return false;

        for (long i = 5; i * i <= n; i = i + 6)
            if (n % i == 0 || n % (i + 2) == 0)
                return false;
        return true;
    }

    public static long pow(long a, long pow) {
        return pow == 0 ? 1 : pow % 2 == 0 ? pow(a * a, pow >> 1) : a * pow(a * a, pow >> 1);
    }

    public static long sumNum(long a) {
        return a * (a + 1) / 2;
    }

    public static int gcd(int n1, int n2) {
        return n2 == 0 ? n1 : gcd(n2, n1 % n2);
    }

    public static long factorial(long a) {
        return a == 0 || a == 1 ? 1 : a * factorial(a - 1);
    }

    public static void sort(int arr[]) {
        shuffle(arr);
        Arrays.sort(arr);
    }

    public static void shuffle(int arr[]) {
        Random rnd = new Random();
        for (int i = arr.length - 1; i > 0; i--) {
            int index = rnd.nextInt(i + 1);
            int temp = arr[index];
            arr[index] = arr[i];
            arr[i] = temp;
        }
    }

    public static Double[] solveQuadratic(double a, double b, double c) {
        double result = (b * b) - 4.0 * a * c;
        double r1;
        if (result > 0.0) {
            r1 = ((double) (-b) + Math.pow(result, 0.5)) / (2.0 * a);
            double r2 = ((double) (-b) - Math.pow(result, 0.5)) / (2.0 * a);
            return new Double[]{r1, r2};
        } else if (result == 0.0) {
            r1 = (double) (-b) / (2.0 * a);
            return new Double[]{r1, r1};
        } else {
            return new Double[]{null, null};
        }
    }

    static class Scanner {
        StringTokenizer st;
        BufferedReader br;

        public Scanner(FileReader r) {
            br = new BufferedReader(r);
        }

        public Scanner(InputStream s) {
            br = new BufferedReader(new InputStreamReader(s));
        }

        public String next() throws IOException {
            while (st == null || !st.hasMoreTokens())
                st = new StringTokenizer(br.readLine());
            return st.nextToken();
        }

        public int nextInt() throws IOException {
            return Integer.parseInt(next());
        }

        public long nextLong() throws IOException {
            return Long.parseLong(next());
        }

        public String nextLine() throws IOException {
            return br.readLine();
        }

        public double nextDouble() throws IOException {
            String x = next();
            StringBuilder sb = new StringBuilder("0");
            double res = 0, f = 1;
            boolean dec = false, neg = false;
            int start = 0;
            if (x.charAt(0) == '-') {
                neg = true;
                start++;
            }
            for (int i = start; i < x.length(); i++)
                if (x.charAt(i) == '.') {
                    res = Long.parseLong(sb.toString());
                    sb = new StringBuilder("0");
                    dec = true;
                } else {
                    sb.append(x.charAt(i));
                    if (dec)
                        f *= 10;
                }
            res += Long.parseLong(sb.toString()) / f;
            return res * (neg ? -1 : 1);
        }

        public boolean ready() throws IOException {
            return br.ready();
        }
    }

    static class pair<E1, E2> implements Comparable<pair> {
        E1 x;
        E2 y;

        pair(E1 x, E2 y) {
            this.x = x;
            this.y = y;
        }

        @Override
        public int compareTo(pair o) {
            return x.equals(o.x) ? (Integer) y - (Integer) o.y : (Integer) x - (Integer) o.x;
        }

        @Override
        public String toString() {
            return x + " " + y;
        }

        public double pointDis(pair p1) {
            return Math.sqrt(((Integer) y - (Integer) p1.y) * ((Integer) y - (Integer) p1.y) + ((Integer) x - (Integer) p1.x) * ((Integer) x - (Integer) p1.x));
        }
    }

}


import java.io.*;
import java.util.*;

public class Solution {
    public static void main(String[] args) {
        FastReader in = new FastReader();
        int n = in.nextInt();
        int[] a = new int[101];
        for (int i = 0; i < n; i++) {
            a[in.nextInt()]++;
        }
        int count = 0;
        for (int i = 1; i < 101; i++) {
            if (a[i] > 0) {
                count++;
                for (int j = i; j < 101; j += i) {
                    a[j] = 0;
                }
            }
        }
        System.out.println(count);

    }

    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            br = new BufferedReader(new
                    InputStreamReader(System.in));
        }

        public int[] nextIntArray(int n) {
            int[] array = new int[n];
            for (int i = 0; i < n; ++i) array[i] = nextInt();
            return array;
        }

        public int[] nextSortedIntArray(int n) {
            int array[] = nextIntArray(n);
            Arrays.sort(array);
            return array;
        }

        public int[] nextSumIntArray(int n) {
            int[] array = new int[n];
            array[0] = nextInt();
            for (int i = 1; i < n; ++i) array[i] = array[i - 1] + nextInt();
            return array;
        }

        public long[] nextLongArray(int n) {
            long[] array = new long[n];
            for (int i = 0; i < n; ++i) array[i] = nextLong();
            return array;
        }

        public long[] nextSumLongArray(int n) {
            long[] array = new long[n];
            array[0] = nextInt();
            for (int i = 1; i < n; ++i) array[i] = array[i - 1] + nextInt();
            return array;
        }

        public long[] nextSortedLongArray(int n) {
            long array[] = nextLongArray(n);
            Arrays.sort(array);
            return array;
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author KharYusuf
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastReader in = new FastReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        APaintTheNumbers solver = new APaintTheNumbers();
        solver.solve(1, in, out);
        out.close();
    }

    static class APaintTheNumbers {
        public void solve(int testNumber, FastReader s, PrintWriter w) {
            int n = s.nextInt();
            boolean[] b = new boolean[n];
            int[] a = new int[n];
            int ans = 0;
            for (int i = 0; i < n; i++) {
                a[i] = s.nextInt();
            }
            func.sort(a);
            for (int i = 0; i < n; i++) {
                if (!b[i]) {
                    ans++;
                    b[i] = true;
                    for (int j = i + 1; j < n; j++) {
                        //w.println(a[j]+" "+a[i]);
                        if (a[j] % a[i] == 0) {
                            b[j] = true;
                        }
                    }
                }
            }
            w.println(ans);
        }

    }

    static class FastReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private FastReader.SpaceCharFilter filter;

        public FastReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {

            if (numChars == -1)
                throw new InputMismatchException();

            if (curChar >= numChars) {

                curChar = 0;

                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }

                if (numChars <= 0)
                    return -1;
            }

            return buf[curChar++];
        }

        public int nextInt() {

            int c = read();

            while (isSpaceChar(c))
                c = read();

            int sgn = 1;

            if (c == '-') {
                sgn = -1;
                c = read();
            }

            int res = 0;

            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();

                res *= 10;
                res += c - '0';
                c = read();
            }
            while (!isSpaceChar(c));

            return res * sgn;
        }

        public boolean isSpaceChar(int c) {

            if (filter != null)
                return filter.isSpaceChar(c);

            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }

    static class func {
        public static void sort(int[] arr) {
            int n = arr.length, mid, h, s, l, i, j, k;
            int[] res = new int[n];
            for (s = 1; s < n; s <<= 1) {
                for (l = 0; l < n - 1; l += (s << 1)) {
                    h = Math.min(l + (s << 1) - 1, n - 1);
                    mid = Math.min(l + s - 1, n - 1);
                    i = l;
                    j = mid + 1;
                    k = l;
                    while (i <= mid && j <= h) res[k++] = (arr[i] <= arr[j] ? arr[i++] : arr[j++]);
                    while (i <= mid) res[k++] = arr[i++];
                    while (j <= h) res[k++] = arr[j++];
                    for (k = l; k <= h; k++) arr[k] = res[k];
                }
            }
        }

    }
}


import java.util.Arrays;
import java.util.Scanner;

public class Main {
    public static void main(String [] args) {
        Scanner scanner = new Scanner(System.in);

        int n = scanner.nextInt();
        int numbers[] = new int[n];
        for (int i = 0; i < n; i++) {
            numbers[i] = scanner.nextInt();
        }
        scanner.close();
        Arrays.sort(numbers);

        boolean[] colored = new boolean[n];
        int res = 0;

        for (int i = 0; i < n; i++) {
            if (!colored[i]) {
                res += 1;
            }
            for (int j = i; j < n; j++) {
                if (numbers[j] % numbers[i] == 0) {
                    colored[j] = true;
                }
            }
        }

        System.out.println(res);
    }
}


//package practice;
import java.io.*;
import java.math.BigInteger;
import java.util.*;
import java.util.Stack;
import java.util.regex.Pattern;

public class ROUGH {

	public static class FastReader {
		BufferedReader br;
		StringTokenizer st;
		//it reads the data about the specified point and divide the data about it ,it is quite fast
		//than using direct

		public FastReader() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		String next() {
			while (st == null || !st.hasMoreTokens()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (Exception r) {
					r.printStackTrace();
				}
			}
			return st.nextToken();
		}

		int nextInt() {
			return Integer.parseInt(next());//converts string to integer
		}

		double nextDouble() {
			return Double.parseDouble(next());
		}

		long nextLong() {
			return Long.parseLong(next());
		}

		String nextLine() {
			String str = "";
			try {
				str = br.readLine();
			} catch (Exception r) {
				r.printStackTrace();
			}
			return str;
		}
	}

	public static PrintWriter out = new PrintWriter (new BufferedOutputStream(System.out));
	static long mod = (long) (1e9+7);
	static int N = (int) 1e5;
//	Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		 FastReader sc = new FastReader();
		 int n = sc.nextInt();
		 int[] a = new int[n];
		 TreeSet<Integer> set = new TreeSet<Integer>();
		 for(int i=0;i<n;++i) {
			 a[i] = sc.nextInt();
			 set.add(a[i]);
		 }
		 long ans = 0;
		 while(set.size() > 0) {
			 ++ans;
			 int min = set.first();
			 TreeSet<Integer> temp = new TreeSet<>();
			 for(int x : set) {
				 if(x%min != 0) temp.add(x);
			 }
			 set = temp;

		 }
		 out.print(ans);

		 out.close();
	}

}


import java.io.*;
import java.lang.reflect.Array;
import java.math.BigInteger;
import java.util.*;

public class Contest {

    final boolean ONLINE_JUDGE = System.getProperty("ONLINE_JUDGE") != null;
    BufferedReader in;
    PrintWriter out;
    StringTokenizer tok = new StringTokenizer("");

    public static void main(String[] args) {
        new Contest().run();
    }

    void init() throws FileNotFoundException {
        if (ONLINE_JUDGE) {
            in = new BufferedReader(new InputStreamReader(System.in));
            out = new PrintWriter(System.out);
        } else {
            in = new BufferedReader(new FileReader("input.txt"));
            out = new PrintWriter("output.txt");
        }
    }

    String readString() throws IOException {
        while (!tok.hasMoreTokens()) {
            tok = new StringTokenizer(in.readLine());
        }
        return tok.nextToken();
    }

    int readInt() throws IOException {
        return Integer.parseInt(readString());
    }

    long readLong() throws IOException {
        return Long.parseLong(readString());
    }

    double readDouble() throws IOException {
        return Double.parseDouble(readString());
    }

    public void run() {
        try {
            long t1 = System.currentTimeMillis();
            init();
            solve();
            out.close();
            long t2 = System.currentTimeMillis();
            System.err.println("Time(ms) = " + (t2 - t1));
        } catch (Exception e) {
            e.printStackTrace(System.err);
            System.exit(-1);
        }
    }

    class MyComparator implements Comparable<MyComparator> {

        int x;
        int y;

        public MyComparator(int x, int y) {
            this.x = x;
            this.y = y;
        }

        @Override
        public int compareTo(MyComparator a) {
            if (x == a.x) {
                return (y - a.y);
            }
            return x - a.x;
        }
    }

    public static boolean isPrime(int num) {
        if (num > 2 && num % 2 == 0) {
            //System.out.println(num + " is not prime");
            return false;
        }
        int top = (int) Math.sqrt(num) + 1;
        for (int i = 3; i < top; i += 2) {
            if (num % i == 0) {
                //System.out.println(num + " is not prime");
                return false;
            }
        }
        //System.out.println(num + " is prime");
        return true;
    }

    private static int lowerBound(int[] a, int low, int high, int element) {
        while (low < high) {
            int middle = low + (high - low) / 2;
            if (element > a[middle]) {
                low = middle + 1;
            } else {
                high = middle;
            }
        }
        return low;
    }

    private static int upperBound(int[] a, int low, int high, int element) {
        while (low < high) {
            int middle = low + (high - low) / 2;
            if (a[middle] > element) {
                high = middle;
            } else {
                low = middle + 1;
            }
        }
        return low;
    }

    public void solve() throws IOException {

        int num_a = readInt();
        int[] array = new int[num_a];
        for (int i = 0; i < num_a; i++) {
            array[i] = readInt();
        }
        int result = 0;

        Arrays.sort(array);
        for (int i = 0; i < array.length; i++) {
            if (array[i] == -1) {
                continue;
            }
            for (int j = 0; j < array.length; j++) {
                if (array[j] != -1 && array[j] % array[i] == 0 && j != i) {
                    //System.out.println(array[j]);
                    array[j] = -1;
                    //result++;
                }
            }
            result++;
        }

        System.out.println(result);
    }

    /**
     *
     * @param a
     * @param b
     * @return
     */
    private BigInteger lcm(BigInteger a, BigInteger b) {
        return a.multiply(b.divide(a.gcd(b)));
    }

}


import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.*;

public class Colours {
    public static void main(String args[] ) throws Exception {

        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String line = br.readLine();
        int n = Integer.parseInt(line);
        line = br.readLine();
        String[] values = line.split(" ");
        int[] arr = new int[n];
        TreeSet<Integer> set = new TreeSet<>();
        for (int i = 0; i < n; i++) {
            arr[i] = Integer.parseInt(values[i]);
            set.add(arr[i]);
        }
        int count=0;
        TreeSet<Integer> copy = new TreeSet<>();

        // for(int i=0;i<n;i++)
        copy.addAll(set);
        int prev = copy.size();

        for(Integer i: set){
           // System.out.println("i "+i);
            if(copy.size()==0){
                break;
            }
            Iterator<Integer> iterator = copy.iterator();
            while (iterator.hasNext()) {
                Integer e = iterator.next();
                if (e % i == 0) {
                    iterator.remove();
                }
            }
            if(copy.size()!=prev){
                count++;
                prev = copy.size();
            }
           // System.out.println("size "+copy.size());

        }

        System.out.println(count);
    }
}


import java.util.*;
import java.io.*;
import java.math.*;
import java.awt.geom.*;
import static java.lang.Math.*;
public class Main implements Runnable
{
    boolean multiiple = false;

    void solve() throws Exception
    {
        int n = sc.nextInt();

        ArrayList<Integer> list = new ArrayList<>();
        for (int i = 0; i < n; i++)
            list.add(sc.nextInt());
        Collections.sort(list);
        int ans = 0;
        while (!list.isEmpty())
        {
            ans++;
            int next = list.get(0);
            for (int i = list.size() - 1; i >= 1; i--)
            {
                if (list.get(i) % next == 0)
                    list.remove(i);
            }
            list.remove(0);
        }

        System.out.println(ans);
    }

    @Override
    public void run()
    {
        try
        {
            in = new BufferedReader(new InputStreamReader(System.in));
            out = new PrintWriter(System.out);
            sc = new FastScanner(in);
            if (multiiple)
            {
                int q = sc.nextInt();
                for (int i = 0; i < q; i++)
                    solve();
            }
            else
                solve();
        }
        catch (Throwable uncaught)
        {
            Main.uncaught = uncaught;
        }
        finally
        {
            out.close();
        }
    }

    public static void main(String[] args) throws Throwable {
        Thread thread = new Thread(null, new Main(), "", (1 << 26));
        thread.start();
        thread.join();
        if (Main.uncaught != null) {
            throw Main.uncaught;
        }
    }

    static Throwable uncaught;
    BufferedReader in;
    FastScanner sc;
    PrintWriter out;
}

class FastScanner
{
    BufferedReader in;
    StringTokenizer st;

    public FastScanner(BufferedReader in)
    {
        this.in = in;
    }

    public String nextToken() throws Exception {
        while (st == null || !st.hasMoreTokens()) {
            st = new StringTokenizer(in.readLine());
        }
        return st.nextToken();
    }

    public int nextInt() throws Exception {
        return Integer.parseInt(nextToken());
    }

    public long nextLong() throws Exception {
        return Long.parseLong(nextToken());
    }

    public double nextDouble() throws Exception {
        return Double.parseDouble(nextToken());
    }

}


import java.io.*;
import java.util.*;

public class Kaudo {
    static Reader in =new Reader();
    static StringBuilder Sd=new StringBuilder();
    static long ans,res,lot,max;
    static List<Integer>gr[];
    static ArrayList<Integer> A=new ArrayList();
    static String ch[];
     public static void main(String [] args) {
        int n=in.nextInt(),a[]=new int [n],g=0;
        for(int i=0;i<n;i++){
        a[i]=in.nextInt();
        if(a[i]==1){System.out.println("1");return;}
        }
        ans=0;
        Arrays.sort(a);
        for(int i=0;i<n;i++){
            int x=a[i];
            if(x>0){ans++;
        for(int u=i;u<n;u++){
        if(a[u]%x==0){a[u]=0;}

        }}

        }
         System.out.println(ans);
     }
     static int gcd(int a,int b){
     if(b==0)return a;
     return gcd(b,a%b);
     }
   static class Reader
    {
        private InputStream mIs;private byte[] buf = new byte[1024];private int curChar,numChars;public Reader() { this(System.in); }public Reader(InputStream is) { mIs = is;}
        public int read() {if (numChars == -1) throw new InputMismatchException();if (curChar >= numChars) {curChar = 0;try { numChars = mIs.read(buf);} catch (IOException e) { throw new InputMismatchException();}if (numChars <= 0) return -1; }return buf[curChar++];}
        public int nextInt(){int c = read() ;while (isSpaceChar(c)) c = read();int sgn = 1;if (c == '-') { sgn = -1 ; c = read() ; }int res = 0;do{if (c < '0' || c > '9') throw new InputMismatchException();res *= 10 ; res += c - '0' ; c = read() ;}while(!isSpaceChar(c));return res * sgn;}
        public boolean isSpaceChar(int c) { return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1; }
    }

}


import java.util.*;

public class PaintNumbers {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int[] nums = new int[n];
        for (int i = 0; i < n; i++) {
            nums[i] = in.nextInt();
        }

        boolean[] visited = new boolean[n];
        int min = Integer.MAX_VALUE;
        int a = 0;
        boolean cont = true;
        while (cont) {
            for (int i = 0; i < n; i++) {
                if (!visited[i]) {
                    min = Math.min(min, nums[i]);
                }
            }

            cont = false;
            for (int i = 0; i < n; i++) {
                if (!visited[i] && nums[i] % min == 0) {
                    cont = true;
                    visited[i] = true;
                }
            }
            a++;
            min = Integer.MAX_VALUE;
        }
        System.out.println(a - 1);
    }

}