codeparrot/codecomplex huggingface dataset:
// Problem: 1209_A. Paint the Numbers
// Time complexity: quadratic
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);
	}
}
// Problem: 1209_A. Paint the Numbers
// Time complexity: quadratic
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();
    }
}
// Problem: 1209_A. Paint the Numbers
// Time complexity: quadratic
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();
    }
}
// Problem: 1209_A. Paint the Numbers
// Time complexity: quadratic
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;
        }
    }
}
// Problem: 1209_A. Paint the Numbers
// Time complexity: quadratic

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);
    }
}
// Problem: 1209_A. Paint the Numbers
// Time complexity: quadratic
//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();
	}
	
}
// Problem: 1209_A. Paint the Numbers
// Time complexity: quadratic

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);
    }
}
// Problem: 1209_A. Paint the Numbers
// Time complexity: quadratic

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());
    }

}
// Problem: 1209_A. Paint the Numbers
// Time complexity: quadratic

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; }
    }
    
}
// Problem: 1209_A. Paint the Numbers
// Time complexity: quadratic
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);
    }



}
// Problem: 1209_A. Paint the Numbers
// Time complexity: quadratic

import java.util.ArrayList;
import java.util.Scanner;

public class PaintTheNumber {

	public static void main(String[] args) {
		
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		
		ArrayList<Integer> l=new ArrayList<Integer>();
		
		for(int i=0; i<n; i++) {
			l.add(sc.nextInt());
		}
		
		boolean c=false;
		
		
			for(int i=0; i<l.size(); i++) {
				if(l.get(i)==-1)
					continue;
				for(int j=0; j<l.size(); j++) {
					
					if(i==j || l.get(j)==-1)
						continue;
					else {
						if(l.get(j)%l.get(i)==0) {
							l.set(j, -1);
						}
					}
				}
			}
			
			int nbr=0;
			for(int i=0; i<l.size(); i++)
				if(l.get(i)!=-1)
					nbr++;
			System.out.println(nbr);
	}

}
// Problem: 1209_A. Paint the Numbers
// Time complexity: quadratic
import java.io.*;
import java.util.*;
import static java.lang.Math.*;

public class A {
    public static void main(String[] args) {
        Scanner input = new Scanner();
        StringBuilder output = new StringBuilder();

        int n = input.nextInt();
        int[] a = new int[n];

        for (int i = 0; i < n; i++) {
            a[i] = input.nextInt();
        }

        Arrays.sort(a);
        boolean[] colored = new boolean[n];
        int colors = 0;
        for (int i = 0; i < n; i++) {
            if (!colored[i]) {
                colors ++;
                colored[i] = true;
                for (int j = i+1; j < n; j++) {
                    if (a[j] % a[i] == 0) {
                        colored[j] = true;
                    }
                }
            }
        }

        System.out.println(colors);
    }

    private static class Scanner {
        BufferedReader br; StringTokenizer st;
        public Scanner(Reader in) { br = new BufferedReader(in); }
        public Scanner() { this(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 readNextLine() {
            String str = "";
            try { str = br.readLine();
            } catch (IOException e) { e.printStackTrace(); }
            return str; }
        int[] readIntArray(int n) {
            int[] a = new int[n];
            for (int idx = 0; idx < n; idx++) { a[idx] = nextInt(); }
            return a; }
        long[] readLongArray(int n) {
            long[] a = new long[n];
            for (int idx = 0; idx < n; idx++) { a[idx] = nextLong(); }
            return a; }
    } // end Scanner
}
// Problem: 1209_A. Paint the Numbers
// Time complexity: quadratic
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Random;
import java.util.StringTokenizer;
 
public class A {
	
	public static void main(String[] args) {
		FastReader scan = new FastReader();
		PrintWriter out = new PrintWriter(System.out);
		Task solver = new Task();
		int t = 1;
		while(t-->0) solver.solve(1, scan, out);
		out.close();
	}
	
	static class Task {
		
		public void solve(int testNumber, FastReader scan, PrintWriter out) {
			int n = scan.nextInt();
			int[] a = new int[n];
			boolean[] b = new boolean[n];
			int count = 0;
			for(int i = 0; i < n; i++) a[i] = scan.nextInt();
			Arrays.sort(a);
			for(int i = 0; i < n; i++) {
				if(b[i]) continue;
				count++;
				for(int j = i; j < n; j++) {
					if(a[j]%a[i] == 0) b[j] = true;
				}
			}
			out.println(count);
		}
	}
	
	static void shuffle(int[] a) {
		Random get = new Random();
		for(int i = 0; i < a.length; i++) {
			int r = get.nextInt(a.length);
			int temp = a[i];
			a[i] = a[r];
			a[r] = temp;
		}
	}
	
	static void shuffle(long[] a) {
		Random get = new Random();
		for(int i = 0; i < a.length; i++) {
			int r = get.nextInt(a.length);
			long temp = a[i];
			a[i] = a[r];
			a[r] = temp;
		}
	}
	
 
	static class FastReader {
		BufferedReader br;
		StringTokenizer st;
 
		public FastReader() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}
		public FastReader(String s) throws FileNotFoundException {
			br = new BufferedReader(new FileReader(new File(s)));
		}
 
		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;
		}
	}
 
}
// Problem: 1209_A. Paint the Numbers
// Time complexity: quadratic
import java.util.*;
import java.io.*;

public class Main {
    public static void main(String[] args) throws IOException{
        BufferedReader f = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(new PrintStream(System.out));
        int n=Integer.parseInt(f.readLine());
        StringTokenizer st=new StringTokenizer(f.readLine());
        int[]arr=new int[n];
        for(int i=0;i<n;i++){
            arr[i]=Integer.parseInt(st.nextToken());
        }
        Arrays.sort(arr);
        int ans=0;
        boolean[]used=new boolean[n];
        for(int i=0;i<n;i++){
            if(!used[i]){
                ans++;
                for(int j=i+1;j<n;j++){
                    if(!used[j] && arr[j]%arr[i]==0){
                        used[j]=true;
                    }
                }
                used[i]=true;
            }
        }
        System.out.print(ans);
        f.close();
        out.close();
    }
}
class pair implements Comparable <pair>{
    int num;
    int idx;

    public int compareTo(pair other){
        return num- other.num;
    }


    pair(int a, int b)
    {
        num=a;
        idx=b;
    }
}