codeparrot/codecomplex huggingface dataset:
// Problem: 1209_A. Paint the Numbers
// Time complexity: quadratic
/**
 * ******* Created by bla on 14/9/19 6:17 PM*******
 */

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

public class A1209 {
    public static void main(String[] args) throws IOException {
        try (Input input = new StandardInput(); PrintWriter writer = new PrintWriter(System.out)) {
            int n = input.nextInt();
            int[] arr = input.readIntArray(n);

            Arrays.sort(arr);
            int ans =0;
            boolean[] vis = new boolean[n];
            for(int i=0;i<n;i++){
                if(!vis[i]){
                    vis[i]=true;
                    for(int j=i+1;j<n;j++){
                        if(!vis[j] && arr[j]%arr[i]==0){
                            vis[j]=true;                    }
                    }
                    ans++;
                }
            }
            System.out.println(ans);
        }
    }

    interface Input extends Closeable {
        String next() throws IOException;

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

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

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

        default int[] readIntArray() throws IOException {
            return readIntArray(nextInt());
        }

        default int[] readIntArray(int size) throws IOException {
            int[] array = new int[size];
            for (int i = 0; i < array.length; i++) {
                array[i] = nextInt();
            }
            return array;
        }

        default long[] readLongArray(int size) throws IOException {
            long[] array = new long[size];
            for (int i = 0; i < array.length; i++) {
                array[i] = nextLong();
            }
            return array;
        }
    }

    private static class StandardInput implements Input {
        private final BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));

        private StringTokenizer stringTokenizer;

        @Override
        public void close() throws IOException {
            reader.close();
        }

        @Override
        public String next() throws IOException {
            if (stringTokenizer == null || !stringTokenizer.hasMoreTokens()) {
                stringTokenizer = new StringTokenizer(reader.readLine());
            }
            return stringTokenizer.nextToken();
        }
    }
}
// Problem: 1209_A. Paint the Numbers
// Time complexity: quadratic
import java.io.*;
import java.util.Arrays;
import java.util.StringTokenizer;

public class mainA {
    public static PrintWriter out = new PrintWriter(System.out);
    public static FastScanner enter = new FastScanner(System.in);
    public static void main(String[] args) throws IOException {
        solve();
        out.close();
    }
    public static boolean[] was;
    private static void solve() throws IOException{
        int n=enter.nextInt();
        int[] arr=new int[n];
        was=new boolean[n];
        for (int i = 0; i <n ; i++) {
            arr[i]=enter.nextInt();
        }
        Arrays.sort(arr);
        int ans=0;
        for (int i = 0; i <n ; i++) {
            if(was[i]) continue;
            find(i, arr);
            ans++;
        }
        out.println(ans);
    }

    public static void find (int num, int[] arr){
        for (int i = num+1; i <arr.length ; i++) {
            if(arr[i]%arr[num]==0) was[i]=true;
        }
    }

    static class FastScanner {
        BufferedReader br;
        StringTokenizer stok;

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

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

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

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

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

        char nextChar() throws IOException {
            return (char) (br.read());
        }

        String nextLine() throws IOException {
            return br.readLine();
        }
    }
}
// Problem: 1209_A. Paint the Numbers
// Time complexity: quadratic
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(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, Scanner in, PrintWriter out) {
            int n = in.nextInt();
            int[] a = new int[n];
            for (int i = 0; i < n; i++) {
                a[i] = in.nextInt();
            }
            Arrays.sort(a);
            int nc = 0;
            for (int i = 0; i < n; i++) {
                boolean divs = false;
                for (int j = 0; j < i; j++) {
                    if (a[i] % a[j] == 0) {
                        divs = true;
                        break;
                    }
                }
                if (!divs) {
                    nc++;
                }
            }
            out.println(nc);
        }

    }
}
// Problem: 1209_A. Paint the Numbers
// Time complexity: quadratic
/**
 * Created by Alyssa Herbst on 9/14/19 9:05 AM.
 */

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

import static java.lang.Math.*;

public class B {
    static StringBuilder sb;
    static int N;
    static int[] A;
    static boolean[] B;
    public static void main(String[] args) {
        FastScanner sc = new FastScanner();
        //Scanner sc = new Scanner(System.in);
        sb = new StringBuilder();
        N = sc.nextInt();
        A = new int[N];
        for (int i = 0; i < N; i++) {
            A[i] = sc.nextInt();
        }
        Arrays.sort(A);
        B = new boolean[N];
        int count = 0;
        for (int i = 0; i < A.length; i++) {
            if(B[i]) {
                continue;
            }
            else {
                count++;
                B[i] = true;
            }
            for (int j = i + 1; j < A.length; j++) {
                if(A[j] % A[i] == 0) {
                    B[j] = true;
                }
            }
        }
        sb.append(count);
        System.out.println(sb);
    }

    public static class FastScanner {
        BufferedReader br;
        StringTokenizer st;

        public FastScanner(Reader in) {
            br = new BufferedReader(in);
        }

        public FastScanner() {
            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[] readIntBrray(int n) {
            int[] a = new int[n];
            for (int idx = 0; idx < n; idx++) {
                a[idx] = nextInt();
            }
            return a;
        }

        long[] readLongBrray(int n) {
            long[] a = new long[n];
            for (int idx = 0; idx < n; idx++) {
                a[idx] = nextLong();
            }
            return a;
        }
    }
}
// Problem: 1209_A. Paint the Numbers
// Time complexity: quadratic
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.io.IOException;
import java.util.StringTokenizer;
import java.util.Arrays;

public class a{
    public static void main(String[] args)throws IOException{
	br = new BufferedReader(new InputStreamReader(System.in));
	PrintWriter out = new PrintWriter(System.out);
	int n = nextInt();
	int v[] = new int[n];
	int fv[] = new int[101];
	for(int i = 0; i<n;i++){
	    v[i] = nextInt();
	}
	Arrays.sort(v);
	for(int i = 0; i<n;i++){
	    for(int j = i; j<n;j++){
		if(v[j]%v[i]==0){
		    v[j] = v[i];
		    fv[v[j]]++;
		}
	    }
	}
	int ans = 0;
	for(int i = 0; i<101;i++){
	    if(fv[i]!=0){
		ans++;
	    }
	}
	out.println(ans);
	out.close();
    }

    static BufferedReader br;
    static StringTokenizer st = new StringTokenizer("");

    static String next()throws IOException{
	while(!st.hasMoreTokens()){
	    st = new StringTokenizer(br.readLine());
	}
	return st.nextToken();
    }
    static int nextInt()throws IOException{
	return Integer.parseInt(next());
    }
    
}
// Problem: 1209_A. Paint the Numbers
// Time complexity: quadratic
import java.io.*;
import java.util.*;
import java.util.Map.Entry;

public class ProblemA {
	public static void main (String args[]) throws IOException{
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		int n=Integer.parseInt(br.readLine());
		String s1=br.readLine();
		String[] s=s1.split(" ");
		int a[] = new int[n];
		for(int i = 0;i<n;i++)
		{
			a[i]=Integer.parseInt(s[i]);
		}
		Arrays.sort(a);
		System.out.println(findColour(a,n));
	}
	public static int findColour(int [] a , int n)
	{
		Map <Integer,Integer> mp = new HashMap<Integer,Integer>();
		int f=0;
		for(int i = 0; i<n;i++)
		{
			f=0;
			for (Map.Entry<Integer,Integer> entry : mp.entrySet()) 
			{
				if(a[i] % entry.getKey()==0)
				{
					f=1;
					break;
				}
			}
			if(f==0)
			{
				mp.put(a[i],1);
			}
				
		}
		return mp.size();
	}
}
// Problem: 1209_A. Paint the Numbers
// Time complexity: quadratic
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Scanner;

public class Loader {
    private final static Scanner in = new Scanner(System.in);

    public static void main(String[] args) {
        int n = in.nextInt();
        ArrayList<Integer> l = new ArrayList<>();

        for (int i = 0; i < n; i++) {
            l.add(in.nextInt());
        }

        Collections.sort(l);


        int k = 0;
        for (int i = 0; i < l.size(); i++) {
            if (l.get(i) == 0) continue;
            for (int j = i + 1; j < l.size(); j++) {
                if (l.get(j) == 0) continue;
                if (l.get(j) % l.get(i) == 0) {
                    l.set(j, 0);
                }
            }

            l.set(i, 0);
            k++;
        }

        System.out.println(k);
    }
}
// Problem: 1209_A. Paint the Numbers
// Time complexity: quadratic
import java.util.*;

/**
 * https://codeforces.com/contests
 */
public class TaskA {

public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    Set<Integer> set = new HashSet<>();
    for (int i = 0; i < n; i++) {
        int a = sc.nextInt();

        boolean flag = false; // true = не нужно добавлять
        List<Integer> toRemove = new ArrayList<>();
        for (int b : set) {
            if (a % b == 0) {
                flag = true;
                break;
            } else if (b % a == 0 && a < b) {
                toRemove.add(b);
            }
        }
        for (int r: toRemove) {
            set.remove(r);
        }
        if (!flag) {
            set.add(a);
        }
    }
    System.out.println(set.size());
}
}
// Problem: 1209_A. Paint the Numbers
// Time complexity: quadratic
import java.io.*;
import java.util.*;
import java.math.*;

public class A {

	public void realMain() throws Exception {

		BufferedReader fin = new BufferedReader(new InputStreamReader(System.in), 1000000);

		String in = fin.readLine();

		String[] ar = in.split(" ");

		int n = Integer.parseInt(ar[0]);
		
		int[] a = new int[n];

		for(int i = 0; i < n; i++) {
			int ret = 0;
			boolean dig = false;
			for (int ch = 0; (ch = fin.read()) != -1; ) {
        			if (ch >= '0' && ch <= '9') {
            				dig = true;
           				ret = ret * 10 + ch - '0';
        			} else if (dig) break;
    			}

			a[i] = ret;
			
		}

		int ret = 0;

		Arrays.sort(a);

		boolean[] colored = new boolean[n];

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

		System.out.println(ret);



	}


	public static void main(String[] args) throws Exception {
		A a = new A();
		a.realMain();
	}
}
// Problem: 1209_A. Paint the Numbers
// Time complexity: quadratic
import java.util.*;

public class PaintTheNumers {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);    
        
        int nums = sc.nextInt();
        
        HashSet<Integer> elements = new HashSet<Integer>();
        for (int i = 0; i < nums; i++) {
            elements.add(sc.nextInt());
        }
        
        ArrayList<Integer> sortedElements = new ArrayList<Integer>(elements);

        Collections.sort(sortedElements);
        
        ArrayList<Integer> lcms = new ArrayList<Integer>();
        
        outer:
        for (int i = 0; i < sortedElements.size(); i++) {
            int ele = sortedElements.get(i);
            for (int j = 0; j < lcms.size(); j++) {
                if (ele % lcms.get(j) == 0) {
                    continue outer;
                }
            }
            lcms.add(ele);
        }
        System.out.println(lcms.size());
        sc.close();
    }
}
// Problem: 1209_A. Paint the Numbers
// Time complexity: quadratic
import java.util.*;
import java.io.*;
import java.math.BigInteger;
public class template {
	public static void main(String[] args) throws Exception {
		FastScanner sc = new FastScanner();
		PrintWriter pw = new PrintWriter(System.out);
		int n = sc.nextInt();
		Integer[] arr = new Integer[n];
		for(int i=0;i<n;i++) {
			arr[i]=sc.nextInt();
		}
		Arrays.sort(arr);
		int ct = 0;
		boolean[] ar = new boolean[n];
		for(int i=0;i<n;i++) {
			if(!ar[i]) {
				ar[i]=true;
				ct++;
				int x = arr[i];
				for(int j=0;j<n;j++) {
					if(arr[j]%x==0) {
						ar[j]=true;
					}
				}
			}
		}
		
		pw.println(ct);
		pw.close();
	}
}
@SuppressWarnings("all")
class FastScanner {
    BufferedReader br;
    StringTokenizer st;
    public FastScanner(BufferedReader d) {
        br=d;
    }
    public FastScanner(String s) {
        try {
            br = new BufferedReader(new FileReader(s));
        } catch (FileNotFoundException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }
 
    public FastScanner() {
        br = new BufferedReader(new InputStreamReader(System.in));
    }
 
    String nextToken() {
        while (st == null || !st.hasMoreElements()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }
 
    int nextInt() {
        return Integer.parseInt(nextToken());
    }
 
    long nextLong() {
        return Long.parseLong(nextToken());
    }
 
    double nextDouble() {
        return Double.parseDouble(nextToken());
    }
}
// Problem: 1209_A. Paint the Numbers
// Time complexity: quadratic
import java.io.*;
import java.util.*;

public class Problem_A {
	
	public static void main(String[] args) {
		MyScanner scan = new MyScanner();
		int n = scan.nextInt();
		int[] elements = new int[n];
		for (int i = 0; i < n; i++)
			elements[i] = scan.nextInt();
		
		int x = 0;
		
		Arrays.sort(elements);
		while(n > 0) {
			x++;
			int[] temp = new int[n];
			int j = 0;
			int size = n;
			int min = elements[0];
			n--;
			for (int i = 1; i < size; i++) {
				if (elements[i]%min == 0) {
					n--;
				}
				else {
					temp[j++] = elements[i];
				}
			}
			
			elements = temp;
		}
		
		out.println(x);
		out.close();
	}

	public static PrintWriter out  = new PrintWriter(new BufferedOutputStream(System.out));
	public static class MyScanner {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st;
		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.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.InputStreamReader;
import java.io.FileNotFoundException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastScanner in = new FastScanner(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, FastScanner in, PrintWriter out) {
            int n = in.nextInt();
            int[] a = in.nextIntArray(n);
            Arrays.sort(a);
            int count = 0;
            boolean[] used = new boolean[n];
            for (int i = 0; i < n; i++) {
                if (!used[i]) {
                    count++;
                    for (int j = i; j < n; j++) {
                        if (a[j] % a[i] == 0) {
                            used[j] = true;
                        }
                    }
                }
            }
            out.println(count);
        }

    }

    static class FastScanner {
        BufferedReader br;
        StringTokenizer st;

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

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

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

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

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

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

public class A {
	public static void main(String[] args) throws IOException {

		/**/
		Scanner sc = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		/*/
		Scanner sc = new Scanner(new BufferedReader(new InputStreamReader(new FileInputStream("src/a.in"))));
		/**/
		
		int n = sc.nextInt();
		int[] a = new int[n];
		for (int i = 0; i < n; i++)
			a[i] = sc.nextInt();
		Arrays.sort(a);
		int ans = 0;
		boolean[] v = new boolean[n];
		for (int i = 0; i < n; i++) {
			if (v[i])
				continue;
			v[i] = true;
			ans++;
			for (int j = i; j < n; j++) {
				if (a[j]%a[i]==0)
					v[j] = true;
			}
		}
		System.out.println(ans);
	}
}
// Problem: 1209_A. Paint the Numbers
// Time complexity: quadratic
import java.util.*;
public class Main {
    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 cnt = 0;
        int pos = 0;
        while (true) {
            while (pos < n && arr[pos] == -1) pos++;
            if (pos == n) break;
            int min = arr[pos];
            arr[pos] = -1;
            cnt++;
            for (int i = pos + 1; i < n; i++) {
                if (arr[i] % min == 0) {
                    arr[i] = -1;
                }
            }
        }
        System.out.println(cnt);
    }
}
// Problem: 1209_A. Paint the Numbers
// Time complexity: quadratic
import java.util.*;
public class paintTheNumbers {
    public static void main (String [] args){
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int [] arr = new int[n];
        for(int i = 0; i < n; i++){
            arr[i] = scanner.nextInt();
        }
        System.out.print(paint(arr));
    }
    public static int paint(int [] arr){
        Arrays.sort(arr);
        HashSet<Integer> set = new HashSet<>();
        int num = arr[0];
        set.add(num);
        for(int i = 1; i < arr.length; i++){
            if(!divBySet(set, arr[i])){
                set.add(arr[i]);
            }

        }
        return set.size();
    }

    /**
     *
     * @param set
     * @param a
     * @return
     */
    public static boolean divBySet(HashSet<Integer> set, int a){
        for(int s: set){
            if(a % s == 0){
                return true;
            }
        }
        return false;
    }

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

public final class paint_and_numers {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int[] a = new int[n];
        for(int i=0;i<n;i++) a[i] = in.nextInt();
        Arrays.sort(a);
        int count = 0;
        boolean[] c = new boolean[n];
        for(int i=0;i<n;i++) {
            if(c[i]==false) {
                c[i]=true;
                count++;
                for(int j=i+1;j<n;j++) {
                    if(a[j]%a[i]==0) {
                        c[j] = true;
                    }
                }
            }
        }
        System.out.println(count);
    }
}