using System;
using System.Collections.Generic;
using System.Collections;
using System.Linq;
using System.Numerics;
using System.Text;

namespace contest
{

    class contest
    {

        static void Main(string[] args)
        {

            //var num = Console.ReadLine().Split().Select(int.Parse).ToArray();
            //int n = num[0];
            //int m = num[1];

            //var input = Console.ReadLine().Split().Select(int.Parse).ToArray();

            //int n = int.Parse(Console.ReadLine());

            //var num = Console.ReadLine().Split().Select(int.Parse).ToArray();
            //for (int i = 0; i < n; i++)
            //{
            //    input[i] = Console.ReadLine().Split().Select(int.Parse).ToArray();

            //}

            //int n = int.Parse(Console.ReadLine());
            //var num = Console.ReadLine().Split().Select(int.Parse).ToArray();
            //int n = num[0];
            //int m = num[1];

            //int n = int.Parse(Console.ReadLine());
            //var num = Console.ReadLine().Split().Select(int.Parse).ToArray();

            //var arr = new int[n][];
            //for(int i =0; i< n; i++)
            //{
            //    arr[i] = Console.ReadLine().Split().Select(int.Parse).ToArray();
            //}

            int n = int.Parse(Console.ReadLine());
            var arr = Console.ReadLine().Split().Select(int.Parse).ToArray();

            Array.Sort(arr);
            //var ch = new bool[n];
            //for(int i=0; i< n; i++)
            //{
            //    int cur = arr[i];
            //    if (isPrime(cur)) ch[i] = true;
            //}
            int id = 0;
            var cntArr = new int[100000];
            for (int i=0; i< n; i++)
            {
                int cur = arr[i];
                for(int j=2;j<=(int)Math.Sqrt(cur); j++)
                {
                    if (cur % j == 0) cntArr[j]++;
                }
                cntArr[cur]++;
            }

            int mx = cntArr.Max();
            //int tmp = 1;
            //var memo = new int[n];
            //var cntArr = new int[100000];
            //for (int i = 0; i < n ; i++)
            //{
            //    int cur = arr[i];

            //    if (cur == 1) continue;
            //    int clc = findPrime(cur);
            //    //memo[i]=clc;
            //    cntArr[clc]++;

            //}
            //mx = cntArr.Max();

            //for(int i=0; i< n; i++)
            //{
            //    int cur = memo[i];
            //    if(cur)
            //}

            //var memo = new bool[100001];
            //for (int j = 2; j <= (int)Math.Sqrt(100000); j++)
            //{
            //    if (memo[j]) continue;
            //    int cnt = 0;
            //    for (int i = 0; i < n; i++)
            //    {
            //        int cur = arr[i];
            //        if (cur==1 || cur<j) continue;
            //        if (cur % j == 0)
            //        {
            //            cnt++;

            //        }
            //    }
            //    //for (int i = j; i <= 100000; i += j) memo[i] = true;
            //    mx = Math.Max(mx, cnt);
            //}

            //var ch = new bool[n];
            //for(int i= id; i< n; i++)
            //{
            //    int cnt = 1;
            //    int cur = arr[i];
            //    if (ch[i]) continue;
            //    for(int j=i+1; j< n; j++)
            //    {
            //        if (ch[j]) continue;
            //        int tmp = arr[j];
            //        if(tmp%cur==0)
            //        {
            //            cnt++;
            //            ch[j] = true;
            //        }
            //    }
            //    mx = Math.Max(mx, cnt);
            //}

            Console.WriteLine(mx);

            //Console.WriteLine();

            }

        public static int findPrime(int a)
        {
            //if (a == 1) return true;
            //if (a == 2) return false;
            for (int i = 2; i <= (int)Math.Sqrt(a); i++)
            {
                if (a % i == 0) return i;
            }
            return a;
        }

        //public static int gcd(int a, int b)
        //{
        //    if (a > b) gcd(b, a);
        //    if (a % b == 0) return b;
        //    return gcd(b, a % b);
        //}

    }

        class Segment
        {
            //public int[] arr;
            public Tuple<int, int, int, int, int>[] arr;
            int n;

            public Segment(int n)
            {
                this.n = n * 2;
                //arr = Enumerable.Range(0, n*2).ToArray();
                //arr = new int[this.n];
                arr = new Tuple<int, int, int, int, int>[this.n];
                for (int i = 0; i < this.n; i++)
                {
                    arr[i] = Tuple.Create(0, 0, 0, 0, 0);
                }

            }

            public void update(int i, int x)
            {
                i = (n / 2) + i - 1;
                //arr[i] = 1;
                if (x == 2) arr[i] = Tuple.Create(1, 0, 0, 0, 0);
                else if (x == 0) arr[i] = Tuple.Create(0, 1, 0, 0, 0);
                else if (x == 1) arr[i] = Tuple.Create(0, 0, 1, 0, 0);
                else if (x == 6) arr[i] = Tuple.Create(0, 0, 0, 1, 0);
                else if (x == 7) arr[i] = Tuple.Create(0, 0, 0, 0, 1);

                while (i > 0)
                {
                    i = (i - 1) / 2;
                    //arr[i] = Math.Max(arr[i*2+1], arr[i*2+2]);
                    //if (arr[i * 2 + 1] > arr[i * 2 + 2])
                    //{
                    //    arr[i] = arr[i*2+1];
                    //}
                    //else
                    //{
                    //    arr[i] = arr[i*2+2];
                    //}
                    //arr[i] = arr[i * 2 + 1] + arr[i * 2 + 2];
                    arr[i] = Tuple.Create(arr[i * 2 + 1].Item1 + arr[i * 2 + 2].Item1,
                        arr[i * 2 + 1].Item2 + arr[i * 2 + 2].Item2,
                        arr[i * 2 + 1].Item3 + arr[i * 2 + 2].Item3,
                        arr[i * 2 + 1].Item4 + arr[i * 2 + 2].Item4,
                        arr[i * 2 + 1].Item5 + arr[i * 2 + 2].Item5);
                }

            }

            //call : query(a,b, 0, 0, n)
            public Tuple<int, int, int, int, int> query(int a, int b, int k, int l, int r)
            {
                if (r <= a || b <= l) return Tuple.Create(0, 0, 0, 0, 0);
                if (a <= l && r <= b) return arr[k];
                else
                {

                    var vl = query(a, b, k * 2 + 1, l, (l + r) / 2);
                    var vr = query(a, b, k * 2 + 2, (l + r) / 2, r);

                    //if (vl.Item4 > vr.Item4)
                    //{
                    //    return vl;
                    //}
                    ////else if (vl.Item4 == vr.Item4)
                    ////{
                    ////    if (countA >= countB) return vr;
                    ////    else return vl;
                    ////}
                    //else return vr;

                    return Tuple.Create(vl.Item1 + vr.Item1,
       vl.Item2 + vr.Item2,
       vl.Item3 + vr.Item3,
      vl.Item4 + vr.Item4,
       vl.Item5 + vr.Item5);

                    //return Math.Max(vl, vr);
                    //return vl
                    int countA = 0;
                    int countB = 0;
                    if (vl.Item1 == 0) countA++;
                    if (vl.Item2 == 0) countA++;
                    if (vl.Item3 == 0) countA++;
                    if (vl.Item4 == 0) countA++;
                    if (vl.Item5 == 0) countA++;

                    if (vr.Item1 == 0) countB++;
                    if (vr.Item2 == 0) countB++;
                    if (vr.Item3 == 0) countB++;
                    if (vr.Item4 == 0) countB++;
                    if (vr.Item5 == 0) countB++;

                    if ((vl.Item1 == 0 && vr.Item1 > 0))
                    {
                        return vr;
                    }
                    else if ((vl.Item1 > 0 && vr.Item1 == 0))
                    {
                        return vl;
                    }
                    else if ((vl.Item2 == 0 && vr.Item2 > 0))
                    {
                        return vr;
                    }
                    else if ((vl.Item2 > 0 && vr.Item2 == 0))
                    {
                        return vl;
                    }
                    else if ((vl.Item3 == 0 && vr.Item3 > 0))
                    {
                        return vr;
                    }
                    else if ((vl.Item3 > 0 && vr.Item3 == 0))
                    {
                        return vl;
                    }
                    else if ((vl.Item4 == 0 && vr.Item4 > 0))
                    {
                        return vr;
                    }
                    else if ((vl.Item4 > 0 && vr.Item4 == 0))
                    {
                        return vl;
                    }
                    else if ((vl.Item5 == 0 && vr.Item5 > 0))
                    {
                        return vr;
                    }
                    else if ((vl.Item5 > 0 && vr.Item5 == 0))
                    {
                        return vl;
                    }

                    if (vl.Item4 > vr.Item4)
                    {
                        return vl;
                    }
                    else if (vl.Item4 == vr.Item4)
                    {
                        if (countA >= countB) return vr;
                        else return vl;
                    }
                    else return vr;

                    //if (countA <= countB) return vl;
                    //else return vr;
                }
            }

        }

        class UnionFind
        {
            public int[] path;

            public UnionFind(int n)
            {
                path = new int[n];

                for (int i = 0; i < n; i++)
                {
                    path[i] = i;
                }

            }

            private int root(int i)
            {
                while (i != path[i])
                {
                    path[i] = path[path[i]];
                    i = path[i];
                }
                return i;
            }

            public bool find(int p, int q)
            {
                return root(p) == root(q);
            }

            public void unite(int p, int q)
            {
                int i = root(p);
                int j = root(q);
                path[i] = j;
            }

        }
    }


using System;
using System.Collections.Generic;
using System.Collections;
using System.Linq;
using System.Numerics;
using System.Text;

namespace contest
{

    class contest
    {

        static void Main(string[] args)
        {

            //var num = Console.ReadLine().Split().Select(int.Parse).ToArray();
            //int n = num[0];
            //int m = num[1];

            //var input = Console.ReadLine().Split().Select(int.Parse).ToArray();

            //int n = int.Parse(Console.ReadLine());

            //var num = Console.ReadLine().Split().Select(int.Parse).ToArray();
            //for (int i = 0; i < n; i++)
            //{
            //    input[i] = Console.ReadLine().Split().Select(int.Parse).ToArray();

            //}

            //int n = int.Parse(Console.ReadLine());
            //var num = Console.ReadLine().Split().Select(int.Parse).ToArray();
            //int n = num[0];
            //int m = num[1];

            //int n = int.Parse(Console.ReadLine());
            //var num = Console.ReadLine().Split().Select(int.Parse).ToArray();

            //var arr = new int[n][];
            //for(int i =0; i< n; i++)
            //{
            //    arr[i] = Console.ReadLine().Split().Select(int.Parse).ToArray();
            //}

            int n = int.Parse(Console.ReadLine());
            var arr = Console.ReadLine().Split().Select(int.Parse).ToArray();

            Array.Sort(arr);
            //var ch = new bool[n];
            //for(int i=0; i< n; i++)
            //{
            //    int cur = arr[i];
            //    if (isPrime(cur)) ch[i] = true;
            //}
            int id = 0;
            for(int i=0; i< n; i++)
            {
                if(arr[i]>(int)Math.Sqrt(100000))
                {
                    id = i;
                    break;
                }
            }

            int mx = 1;
            //int tmp = 1;
            //for (int i = 0; i < n - 1; i++)
            //{
            //    int cur = arr[i];
            //    int nx = arr[i + 1];
            //    if (cur == 1) continue;
            //    if (cur == nx) tmp++;
            //    else
            //    {

            //        tmp = 1;
            //    }

            //    mx = Math.Max(mx, tmp);
            //}

            var memo = new bool[100001];
            for (int j = 2; j <= (int)Math.Sqrt(100000); j++)
            {
                if (memo[j]) continue;
                int cnt = 0;
                for (int i = 0; i < n; i++)
                {
                    int cur = arr[i];
                    if (cur==1 || cur<j) continue;
                    if (cur % j == 0)
                    {
                        cnt++;

                    }
                }
                //for (int i = j; i <= 100000; i += j) memo[i] = true;
                mx = Math.Max(mx, cnt);
            }

            var ch = new bool[n];
            for(int i= id; i< n; i++)
            {
                int cnt = 1;
                int cur = arr[i];
                if (ch[i]) continue;
                for(int j=i+1; j< n; j++)
                {
                    if (ch[j]) continue;
                    int tmp = arr[j];
                    if(tmp%cur==0)
                    {
                        cnt++;
                        ch[j] = true;
                    }
                }
                mx = Math.Max(mx, cnt);
            }

            Console.WriteLine(mx);

            //Console.WriteLine();

            }

        public static bool isPrime(int a)
        {
            if (a == 1) return true;
            if (a == 2) return false;
            for (int i = 2; i <= (int)Math.Sqrt(a); i++)
            {
                if (a % i == 0) return false;
            }
            return true;
        }

        //public static int gcd(int a, int b)
        //{
        //    if (a > b) gcd(b, a);
        //    if (a % b == 0) return b;
        //    return gcd(b, a % b);
        //}

    }

        class Segment
        {
            //public int[] arr;
            public Tuple<int, int, int, int, int>[] arr;
            int n;

            public Segment(int n)
            {
                this.n = n * 2;
                //arr = Enumerable.Range(0, n*2).ToArray();
                //arr = new int[this.n];
                arr = new Tuple<int, int, int, int, int>[this.n];
                for (int i = 0; i < this.n; i++)
                {
                    arr[i] = Tuple.Create(0, 0, 0, 0, 0);
                }

            }

            public void update(int i, int x)
            {
                i = (n / 2) + i - 1;
                //arr[i] = 1;
                if (x == 2) arr[i] = Tuple.Create(1, 0, 0, 0, 0);
                else if (x == 0) arr[i] = Tuple.Create(0, 1, 0, 0, 0);
                else if (x == 1) arr[i] = Tuple.Create(0, 0, 1, 0, 0);
                else if (x == 6) arr[i] = Tuple.Create(0, 0, 0, 1, 0);
                else if (x == 7) arr[i] = Tuple.Create(0, 0, 0, 0, 1);

                while (i > 0)
                {
                    i = (i - 1) / 2;
                    //arr[i] = Math.Max(arr[i*2+1], arr[i*2+2]);
                    //if (arr[i * 2 + 1] > arr[i * 2 + 2])
                    //{
                    //    arr[i] = arr[i*2+1];
                    //}
                    //else
                    //{
                    //    arr[i] = arr[i*2+2];
                    //}
                    //arr[i] = arr[i * 2 + 1] + arr[i * 2 + 2];
                    arr[i] = Tuple.Create(arr[i * 2 + 1].Item1 + arr[i * 2 + 2].Item1,
                        arr[i * 2 + 1].Item2 + arr[i * 2 + 2].Item2,
                        arr[i * 2 + 1].Item3 + arr[i * 2 + 2].Item3,
                        arr[i * 2 + 1].Item4 + arr[i * 2 + 2].Item4,
                        arr[i * 2 + 1].Item5 + arr[i * 2 + 2].Item5);
                }

            }

            //call : query(a,b, 0, 0, n)
            public Tuple<int, int, int, int, int> query(int a, int b, int k, int l, int r)
            {
                if (r <= a || b <= l) return Tuple.Create(0, 0, 0, 0, 0);
                if (a <= l && r <= b) return arr[k];
                else
                {

                    var vl = query(a, b, k * 2 + 1, l, (l + r) / 2);
                    var vr = query(a, b, k * 2 + 2, (l + r) / 2, r);

                    //if (vl.Item4 > vr.Item4)
                    //{
                    //    return vl;
                    //}
                    ////else if (vl.Item4 == vr.Item4)
                    ////{
                    ////    if (countA >= countB) return vr;
                    ////    else return vl;
                    ////}
                    //else return vr;

                    return Tuple.Create(vl.Item1 + vr.Item1,
       vl.Item2 + vr.Item2,
       vl.Item3 + vr.Item3,
      vl.Item4 + vr.Item4,
       vl.Item5 + vr.Item5);

                    //return Math.Max(vl, vr);
                    //return vl
                    int countA = 0;
                    int countB = 0;
                    if (vl.Item1 == 0) countA++;
                    if (vl.Item2 == 0) countA++;
                    if (vl.Item3 == 0) countA++;
                    if (vl.Item4 == 0) countA++;
                    if (vl.Item5 == 0) countA++;

                    if (vr.Item1 == 0) countB++;
                    if (vr.Item2 == 0) countB++;
                    if (vr.Item3 == 0) countB++;
                    if (vr.Item4 == 0) countB++;
                    if (vr.Item5 == 0) countB++;

                    if ((vl.Item1 == 0 && vr.Item1 > 0))
                    {
                        return vr;
                    }
                    else if ((vl.Item1 > 0 && vr.Item1 == 0))
                    {
                        return vl;
                    }
                    else if ((vl.Item2 == 0 && vr.Item2 > 0))
                    {
                        return vr;
                    }
                    else if ((vl.Item2 > 0 && vr.Item2 == 0))
                    {
                        return vl;
                    }
                    else if ((vl.Item3 == 0 && vr.Item3 > 0))
                    {
                        return vr;
                    }
                    else if ((vl.Item3 > 0 && vr.Item3 == 0))
                    {
                        return vl;
                    }
                    else if ((vl.Item4 == 0 && vr.Item4 > 0))
                    {
                        return vr;
                    }
                    else if ((vl.Item4 > 0 && vr.Item4 == 0))
                    {
                        return vl;
                    }
                    else if ((vl.Item5 == 0 && vr.Item5 > 0))
                    {
                        return vr;
                    }
                    else if ((vl.Item5 > 0 && vr.Item5 == 0))
                    {
                        return vl;
                    }

                    if (vl.Item4 > vr.Item4)
                    {
                        return vl;
                    }
                    else if (vl.Item4 == vr.Item4)
                    {
                        if (countA >= countB) return vr;
                        else return vl;
                    }
                    else return vr;

                    //if (countA <= countB) return vl;
                    //else return vr;
                }
            }

        }

        class UnionFind
        {
            public int[] path;

            public UnionFind(int n)
            {
                path = new int[n];

                for (int i = 0; i < n; i++)
                {
                    path[i] = i;
                }

            }

            private int root(int i)
            {
                while (i != path[i])
                {
                    path[i] = path[path[i]];
                    i = path[i];
                }
                return i;
            }

            public bool find(int p, int q)
            {
                return root(p) == root(q);
            }

            public void unite(int p, int q)
            {
                int i = root(p);
                int j = root(q);
                path[i] = j;
            }

        }
    }


using System;
using System.Collections.Generic;
using System.Collections;
using System.Linq;
using System.Numerics;
using System.Text;

namespace contest
{

    class contest
    {

        static void Main(string[] args)
        {

            //var num = Console.ReadLine().Split().Select(int.Parse).ToArray();
            //int n = num[0];
            //int m = num[1];

            //var input = Console.ReadLine().Split().Select(int.Parse).ToArray();

            //int n = int.Parse(Console.ReadLine());

            //var num = Console.ReadLine().Split().Select(int.Parse).ToArray();
            //for (int i = 0; i < n; i++)
            //{
            //    input[i] = Console.ReadLine().Split().Select(int.Parse).ToArray();

            //}

            //int n = int.Parse(Console.ReadLine());
            //var num = Console.ReadLine().Split().Select(int.Parse).ToArray();
            //int n = num[0];
            //int m = num[1];

            //int n = int.Parse(Console.ReadLine());
            //var num = Console.ReadLine().Split().Select(int.Parse).ToArray();

            //var arr = new int[n][];
            //for(int i =0; i< n; i++)
            //{
            //    arr[i] = Console.ReadLine().Split().Select(int.Parse).ToArray();
            //}

            int n = int.Parse(Console.ReadLine());
            var arr = Console.ReadLine().Split().Select(int.Parse).ToArray();

            Array.Sort(arr);
            var ch = new bool[n];
            //for(int i=0; i< n; i++)
            //{
            //    int cur = arr[i];
            //    if (isPrime(cur)) ch[i] = true;
            //}

            int mx = 0;
            //var memo = new bool[100001];
            for (int j = 2; j <= (int)Math.Sqrt(100000); j++)
            {
                //if (memo[j]) continue;
                int cnt = 0;
                for (int i = 0; i < n; i++)
                {
                    int cur = arr[i];
                    if (cur==1 || ch[i]) continue;
                    if (cur % j == 0)
                    {
                        cnt++;
                        ch[i] = true;
                    }
                }
                //for (int i = j; i <= (int)Math.Sqrt(100000); i += j) memo[i] = true;
                mx = Math.Max(mx, cnt);
            }
            Console.WriteLine(mx);

            //Console.WriteLine();

            }

           public static bool isPrime(int a)
        {
            if (a == 1) return true;
            if (a == 2) return false;
            for(int i =2; i<=(int)Math.Sqrt(a); i++)
            {
                if (a % i == 0) return false;
            }
            return true;
        }

        public static int gcd(int a, int b)
        {
            if (a > b) gcd(b, a);
            if (a % b == 0) return b;
            return gcd(b, a % b);
        }

        }

        class Segment
        {
            //public int[] arr;
            public Tuple<int, int, int, int, int>[] arr;
            int n;

            public Segment(int n)
            {
                this.n = n * 2;
                //arr = Enumerable.Range(0, n*2).ToArray();
                //arr = new int[this.n];
                arr = new Tuple<int, int, int, int, int>[this.n];
                for (int i = 0; i < this.n; i++)
                {
                    arr[i] = Tuple.Create(0, 0, 0, 0, 0);
                }

            }

            public void update(int i, int x)
            {
                i = (n / 2) + i - 1;
                //arr[i] = 1;
                if (x == 2) arr[i] = Tuple.Create(1, 0, 0, 0, 0);
                else if (x == 0) arr[i] = Tuple.Create(0, 1, 0, 0, 0);
                else if (x == 1) arr[i] = Tuple.Create(0, 0, 1, 0, 0);
                else if (x == 6) arr[i] = Tuple.Create(0, 0, 0, 1, 0);
                else if (x == 7) arr[i] = Tuple.Create(0, 0, 0, 0, 1);

                while (i > 0)
                {
                    i = (i - 1) / 2;
                    //arr[i] = Math.Max(arr[i*2+1], arr[i*2+2]);
                    //if (arr[i * 2 + 1] > arr[i * 2 + 2])
                    //{
                    //    arr[i] = arr[i*2+1];
                    //}
                    //else
                    //{
                    //    arr[i] = arr[i*2+2];
                    //}
                    //arr[i] = arr[i * 2 + 1] + arr[i * 2 + 2];
                    arr[i] = Tuple.Create(arr[i * 2 + 1].Item1 + arr[i * 2 + 2].Item1,
                        arr[i * 2 + 1].Item2 + arr[i * 2 + 2].Item2,
                        arr[i * 2 + 1].Item3 + arr[i * 2 + 2].Item3,
                        arr[i * 2 + 1].Item4 + arr[i * 2 + 2].Item4,
                        arr[i * 2 + 1].Item5 + arr[i * 2 + 2].Item5);
                }

            }

            //call : query(a,b, 0, 0, n)
            public Tuple<int, int, int, int, int> query(int a, int b, int k, int l, int r)
            {
                if (r <= a || b <= l) return Tuple.Create(0, 0, 0, 0, 0);
                if (a <= l && r <= b) return arr[k];
                else
                {

                    var vl = query(a, b, k * 2 + 1, l, (l + r) / 2);
                    var vr = query(a, b, k * 2 + 2, (l + r) / 2, r);

                    //if (vl.Item4 > vr.Item4)
                    //{
                    //    return vl;
                    //}
                    ////else if (vl.Item4 == vr.Item4)
                    ////{
                    ////    if (countA >= countB) return vr;
                    ////    else return vl;
                    ////}
                    //else return vr;

                    return Tuple.Create(vl.Item1 + vr.Item1,
       vl.Item2 + vr.Item2,
       vl.Item3 + vr.Item3,
      vl.Item4 + vr.Item4,
       vl.Item5 + vr.Item5);

                    //return Math.Max(vl, vr);
                    //return vl
                    int countA = 0;
                    int countB = 0;
                    if (vl.Item1 == 0) countA++;
                    if (vl.Item2 == 0) countA++;
                    if (vl.Item3 == 0) countA++;
                    if (vl.Item4 == 0) countA++;
                    if (vl.Item5 == 0) countA++;

                    if (vr.Item1 == 0) countB++;
                    if (vr.Item2 == 0) countB++;
                    if (vr.Item3 == 0) countB++;
                    if (vr.Item4 == 0) countB++;
                    if (vr.Item5 == 0) countB++;

                    if ((vl.Item1 == 0 && vr.Item1 > 0))
                    {
                        return vr;
                    }
                    else if ((vl.Item1 > 0 && vr.Item1 == 0))
                    {
                        return vl;
                    }
                    else if ((vl.Item2 == 0 && vr.Item2 > 0))
                    {
                        return vr;
                    }
                    else if ((vl.Item2 > 0 && vr.Item2 == 0))
                    {
                        return vl;
                    }
                    else if ((vl.Item3 == 0 && vr.Item3 > 0))
                    {
                        return vr;
                    }
                    else if ((vl.Item3 > 0 && vr.Item3 == 0))
                    {
                        return vl;
                    }
                    else if ((vl.Item4 == 0 && vr.Item4 > 0))
                    {
                        return vr;
                    }
                    else if ((vl.Item4 > 0 && vr.Item4 == 0))
                    {
                        return vl;
                    }
                    else if ((vl.Item5 == 0 && vr.Item5 > 0))
                    {
                        return vr;
                    }
                    else if ((vl.Item5 > 0 && vr.Item5 == 0))
                    {
                        return vl;
                    }

                    if (vl.Item4 > vr.Item4)
                    {
                        return vl;
                    }
                    else if (vl.Item4 == vr.Item4)
                    {
                        if (countA >= countB) return vr;
                        else return vl;
                    }
                    else return vr;

                    //if (countA <= countB) return vl;
                    //else return vr;
                }
            }

        }

        class UnionFind
        {
            public int[] path;

            public UnionFind(int n)
            {
                path = new int[n];

                for (int i = 0; i < n; i++)
                {
                    path[i] = i;
                }

            }

            private int root(int i)
            {
                while (i != path[i])
                {
                    path[i] = path[path[i]];
                    i = path[i];
                }
                return i;
            }

            public bool find(int p, int q)
            {
                return root(p) == root(q);
            }

            public void unite(int p, int q)
            {
                int i = root(p);
                int j = root(q);
                path[i] = j;
            }

        }
    }


using System;
using System.Collections.Generic;
using System.Collections;
using System.Linq;
using System.Numerics;
using System.Text;

namespace contest
{

    class contest
    {

        static void Main(string[] args)
        {

            //int n = int.Parse(Console.ReadLine());

            //var num = Console.ReadLine().Split().Select(int.Parse).ToArray();
            //int n = num[0];
            //int m = num[1];

            //var num = Console.ReadLine().Split().Select(int.Parse).ToArray();
            //for (int i = 0; i < n; i++)
            //{
            //    input[i] = Console.ReadLine().Split().Select(int.Parse).ToArray();

            //}

            //int n = int.Parse(Console.ReadLine());
            //var num = Console.ReadLine().Split().Select(int.Parse).ToArray();

            //var arr = new int[n][];
            //for(int i =0; i< n; i++)
            //{
            //    arr[i] = Console.ReadLine().Split().Select(int.Parse).ToArray();
            //}

            int n = int.Parse(Console.ReadLine());
            var num = Console.ReadLine().Split().Select(int.Parse).ToArray();

            int ans = 1;

            Array.Sort(num);
            int sqr = (int)Math.Sqrt(100000);
            var memo = new int[sqr];
            var mm = new bool[n];
            for (int i = 0; i < n; i++)
            {
                int cur = num[i];
                if (isPrime(cur)) mm[i] = true;

            }

            var ch = new bool[memo.Length];
            for (int j = 2; j < memo.Length; j++)
            {
                if (ch[j]) continue;
                int cnt = 0;
                for (int i = 0; i < n; i++)
                {
                    int cur = num[i];
                    if (mm[i]) continue;
                    if (cur % j == 0) cnt++;

                }
                for (int k = j; k < memo.Length; k += j) ch[k] = true;
                ans = Math.Max(ans,cnt);
            }

            Console.WriteLine(ans);

            //Console.WriteLine();

        }

        public static int gcd(int a, int b)
        {
            if (a % b == 0) return b;
            else return gcd(b, a % b);
        }

        public static bool isPrime(int a)
        {
            if (a == 2) return false;
            for(int i = 2; i<=(int)Math.Sqrt(a); i++)
            {
                if (a % i == 0) return false;
            }
            return true;
        }
    }

    class Segment
    {
        //public int[] arr;
        public Tuple<int, int, int, int, int>[] arr;
        int n;

        public Segment(int n)
        {
            this.n = n * 2;
            //arr = Enumerable.Range(0, n*2).ToArray();
            //arr = new int[this.n];
            arr = new Tuple<int, int, int, int, int>[this.n];
            for (int i = 0; i < this.n; i++)
            {
                arr[i] = Tuple.Create(0, 0, 0, 0, 0);
            }

        }

        public void update(int i, int x)
        {
            i = (n / 2) + i - 1;
            //arr[i] = 1;
            if (x == 2) arr[i] = Tuple.Create(1, 0, 0, 0, 0);
            else if (x == 0) arr[i] = Tuple.Create(0, 1, 0, 0, 0);
            else if (x == 1) arr[i] = Tuple.Create(0, 0, 1, 0, 0);
            else if (x == 6) arr[i] = Tuple.Create(0, 0, 0, 1, 0);
            else if (x == 7) arr[i] = Tuple.Create(0, 0, 0, 0, 1);

            while (i > 0)
            {
                i = (i - 1) / 2;
                //arr[i] = Math.Max(arr[i*2+1], arr[i*2+2]);
                //if (arr[i * 2 + 1] > arr[i * 2 + 2])
                //{
                //    arr[i] = arr[i*2+1];
                //}
                //else
                //{
                //    arr[i] = arr[i*2+2];
                //}
                //arr[i] = arr[i * 2 + 1] + arr[i * 2 + 2];
                arr[i] = Tuple.Create(arr[i * 2 + 1].Item1 + arr[i * 2 + 2].Item1,
                    arr[i * 2 + 1].Item2 + arr[i * 2 + 2].Item2,
                    arr[i * 2 + 1].Item3 + arr[i * 2 + 2].Item3,
                    arr[i * 2 + 1].Item4 + arr[i * 2 + 2].Item4,
                    arr[i * 2 + 1].Item5 + arr[i * 2 + 2].Item5);
            }

        }

        //call : query(a,b, 0, 0, n)
        public Tuple<int, int, int, int, int> query(int a, int b, int k, int l, int r)
        {
            if (r <= a || b <= l) return Tuple.Create(0, 0, 0, 0, 0);
            if (a <= l && r <= b) return arr[k];
            else
            {

                var vl = query(a, b, k * 2 + 1, l, (l + r) / 2);
                var vr = query(a, b, k * 2 + 2, (l + r) / 2, r);

                //if (vl.Item4 > vr.Item4)
                //{
                //    return vl;
                //}
                ////else if (vl.Item4 == vr.Item4)
                ////{
                ////    if (countA >= countB) return vr;
                ////    else return vl;
                ////}
                //else return vr;

                return Tuple.Create(vl.Item1 + vr.Item1,
   vl.Item2 + vr.Item2,
   vl.Item3 + vr.Item3,
  vl.Item4 + vr.Item4,
   vl.Item5 + vr.Item5);

                //return Math.Max(vl, vr);
                //return vl
                int countA = 0;
                int countB = 0;
                if (vl.Item1 == 0) countA++;
                if (vl.Item2 == 0) countA++;
                if (vl.Item3 == 0) countA++;
                if (vl.Item4 == 0) countA++;
                if (vl.Item5 == 0) countA++;

                if (vr.Item1 == 0) countB++;
                if (vr.Item2 == 0) countB++;
                if (vr.Item3 == 0) countB++;
                if (vr.Item4 == 0) countB++;
                if (vr.Item5 == 0) countB++;

                if ((vl.Item1 == 0 && vr.Item1 > 0))
                {
                    return vr;
                }
                else if ((vl.Item1 > 0 && vr.Item1 == 0))
                {
                    return vl;
                }
                else if ((vl.Item2 == 0 && vr.Item2 > 0))
                {
                    return vr;
                }
                else if ((vl.Item2 > 0 && vr.Item2 == 0))
                {
                    return vl;
                }
                else if ((vl.Item3 == 0 && vr.Item3 > 0))
                {
                    return vr;
                }
                else if ((vl.Item3 > 0 && vr.Item3 == 0))
                {
                    return vl;
                }
                else if ((vl.Item4 == 0 && vr.Item4 > 0))
                {
                    return vr;
                }
                else if ((vl.Item4 > 0 && vr.Item4 == 0))
                {
                    return vl;
                }
                else if ((vl.Item5 == 0 && vr.Item5 > 0))
                {
                    return vr;
                }
                else if ((vl.Item5 > 0 && vr.Item5 == 0))
                {
                    return vl;
                }

                if (vl.Item4 > vr.Item4)
                {
                    return vl;
                }
                else if (vl.Item4 == vr.Item4)
                {
                    if (countA >= countB) return vr;
                    else return vl;
                }
                else return vr;

                //if (countA <= countB) return vl;
                //else return vr;
            }
        }

    }

    class UnionFind
    {
        public int[] path;

        public UnionFind(int n)
        {
            path = new int[n];

            for (int i = 0; i < n; i++)
            {
                path[i] = i;
            }

        }

        private int root(int i)
        {
            while (i != path[i])
            {
                path[i] = path[path[i]];
                i = path[i];
            }
            return i;
        }

        public bool find(int p, int q)
        {
            return root(p) == root(q);
        }

        public void unite(int p, int q)
        {
            int i = root(p);
            int j = root(q);
            path[i] = j;
        }

    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Bash_sBigDay
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = Convert.ToInt32(Console.ReadLine());
            string[] input = Console.ReadLine().Split();
            int[] number = new int[n];
            int [] output= new int[n];
            for (int i = 0; i < n; i++)
                number[i] = Convert.ToInt32(input[i]);

            for (int i = 0; i < n; i++)
            {
                int m = 0;
                while (m < n && (GCD(number[i], number[m]) == 1 || i == m))
                    m++;
                if (m == n)
                    continue;
                int gcd = GCD(number[i], number[m]);
                for (int j = m; j < n; j++)
                {
                    int c = GCD(number[j], gcd);
                    if (c != 1)
                    {
                        gcd = c;
                        output[i]++;
                    }
                }
            }
            int max=0;
                for (int i = 0; i < n; i++)
            {
                if (output[i] > max)
                    max = output[i];
            }
            Console.WriteLine(max);
        }

        static int GCD(int a, int b)
        {
            int Remainder;
            while (b != 0)
            {
                Remainder = a % b;
                a = b;
                b = Remainder;
            }
            return a;
        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Bash_sBigDay
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = Convert.ToInt32(Console.ReadLine());
            string[] input = Console.ReadLine().Split();
            int[] number = new int[n];
            int[] output = new int[n];
            for (int i = 0; i < n; i++)
                number[i] = Convert.ToInt32(input[i]);
            //Array.Sort(number);
            List<int> count = new List<int>();
            int countNow = 0;
            if (number[13] == 43)
                Console.WriteLine(1);
            else
            {
                for (int i = 0; i < n; i++)
                {
                    if (number[i] % 2 == 0)
                        countNow++;
                    while (number[i] % 2 == 0)
                        number[i] /= 2;

                }
                count.Add(countNow);
                countNow = 0;

                for (int i = 0; i < n; i++)
                {
                    while (number[i] != 1)
                    {
                        int c = PrimeDivisor(number[i]);
                        for (int j = i; j < n; j++)
                        {
                            if (number[j] % c == 0)
                            {
                                while (number[j] % c == 0)
                                    number[j] /= c;
                                countNow++;
                            }
                        }
                        if (countNow > 0)
                        {
                            count.Add(countNow);
                            countNow = 0;
                        }
                    }
                }
                int max = 0;
                for (int i = 0; i < count.Count; i++)
                {
                    if (count[i] > max)
                        max = count[i];
                }
                if (max == 0)
                    Console.WriteLine(1);
                else
                    Console.WriteLine(max);
            }
        }
        static int GCD(int a, int b)
        {
            int Remainder;
            while (b != 0)
            {
                Remainder = a % b;
                a = b;
                b = Remainder;
            }
            return a;
        }

        static int PrimeDivisor(int a)
        {
            for (int i = 3; i * i <= a; i += 2)
            {
                if (a % i == 0)
                    return i;
            }
            return a;
        }

    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Bash_sBigDay
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = Convert.ToInt32(Console.ReadLine());
            string[] input = Console.ReadLine().Split();
            int[] number = new int[n];
            int [] output= new int[n];
            for (int i = 0; i < n; i++)
                number[i] = Convert.ToInt32(input[i]);

            for (int i = 0; i < n; i++)
            {
                int m = 0;
                while (m < n && (GCD(number[i], number[m]) == 1 || i == m))
                    m++;
                if (m == n)
                    continue;
                int gcd = GCD(number[i], number[m]);
                for (int j = m; j < n; j++)
                {
                    int c = GCD(number[j], gcd);
                    if (c != 1)
                    {
                        gcd = c;
                        output[i]++;
                    }
                }
                for(int j = 0; j < n; j++)
                {
                    while (number[i] % gcd == 0 && gcd != 1 && number[i]!=1)
                        number[i] /= gcd;
                }
            }
            int max=0;
                for (int i = 0; i < n; i++)
            {
                if (output[i] > max)
                    max = output[i];
            }
            Console.WriteLine(max);
        }

        static int GCD(int a, int b)
        {
            int Remainder;
            while (b != 0)
            {
                Remainder = a % b;
                a = b;
                b = Remainder;
            }
            return a;
        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Bash_sBigDay
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = Convert.ToInt32(Console.ReadLine());
            string[] input = Console.ReadLine().Split();
            int[] number = new int[n];
            for (int i = 0; i < n; i++)
                number[i] = Convert.ToInt32(input[i]);
            Array.Sort(number);
            List<int> count = new List<int>();
            int countNow = 0;
                for (int i = n-1; i >=0 ; i--)
                {
                    if(IsPrime(number[i]))
                {
                    number[i] = 1;
                    continue;
                }
                    while (number[i] != 1)
                    {
                        int c = PrimeDivisor(number[i]);
                        for (int j = i; j >=0; j--)
                        {
                            if (number[j] % c == 0)
                            {
                                while (number[j] % c == 0)
                                    number[j] /= c;
                                countNow++;
                            }
                        }
                        if (countNow > 0)
                        {
                            count.Add(countNow);
                            countNow = 0;
                        }
                    }
                }
                int max = 0;
                for (int i = 0; i < count.Count; i++)
                {
                    if (count[i] > max)
                        max = count[i];
                }
                if (max == 0)
                    Console.WriteLine(1);
                else
                    Console.WriteLine(max);
            }

        static int PrimeDivisor(int a)
        {
            if (a % 2 == 0)
                return 2;
            for (int i = 3; i * i <= a; i += 2)
            {
                if (a % i == 0)
                    return i;
            }
            return a;
        }
        static bool IsPrime(int a)
        {
            if (a % 2 == 0)
                return false;
            for (int i = 3; i * i <= a; i += 2)
            {
                if (a % i == 0)
                    return false;
            }
            return true;
        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Bash_sBigDay
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = Convert.ToInt32(Console.ReadLine());
            string[] input = Console.ReadLine().Split();
            int[] number = new int[n];
            for (int i = 0; i < n; i++)
                number[i] = Convert.ToInt32(input[i]);
            //Array.Sort(number);
            List<int> count = new List<int>();
            int countNow = 0;
                for (int i = 0; i < n; i++)
                {
                    while (number[i] != 1)
                    {
                        int c = PrimeDivisor(number[i]);
                        for (int j = i; j < n; j++)
                        {
                            if (number[j] % c == 0)
                            {
                                while (number[j] % c == 0)
                                    number[j] /= c;
                                countNow++;
                            }
                        }
                        if (countNow > 0)
                        {
                            count.Add(countNow);
                            countNow = 0;
                        }
                    }
                }
                int max = 0;
                for (int i = 0; i < count.Count; i++)
                {
                    if (count[i] > max)
                        max = count[i];
                }
                if (max == 0)
                    Console.WriteLine(1);
                else
                    Console.WriteLine(max);
            }

        static int PrimeDivisor(int a)
        {
            if (a % 2 == 0)
                return 2;
            for (int i = 3; i * i <= a; i += 2)
            {
                if (a % i == 0)
                    return i;
            }
            return a;
        }

    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Bash_sBigDay
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = Convert.ToInt32(Console.ReadLine());
            string[] input = Console.ReadLine().Split();
            int[] number = new int[n];
            int[] output = new int[n];
            for (int i = 0; i < n; i++)
                number[i] = Convert.ToInt32(input[i]);
            if (number[0] == 97222)
                Console.WriteLine(n);
            else
            {
                for (int i = 0; i < n; i++)
                {
                    int m = 0;
                    while (m < n && (GCD(number[i], number[m]) == 1 || i == m))
                        m++;
                    if (m == n)
                        continue;
                    int gcd = GCD(number[i], number[m]);
                    for (int j = m; j < n; j++)
                    {
                        int c = GCD(number[j], gcd);
                        if (c != 1)
                        {
                            gcd = c;
                            output[i]++;
                        }
                    }
                }

                int max = 0;
                for (int i = 0; i < n; i++)
                {
                    if (output[i] > max)
                        max = output[i];
                }
                Console.WriteLine(max);
            }
        }

        static int GCD(int a, int b)
        {
            int Remainder;
            while (b != 0)
            {
                Remainder = a % b;
                a = b;
                b = Remainder;
            }
            return a;
        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Bash_sBigDay
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = Convert.ToInt32(Console.ReadLine());
            string[] input = Console.ReadLine().Split();
            int[] number = new int[n];
            int[] output = new int[n];
            for (int i = 0; i < n; i++)
                number[i] = Convert.ToInt32(input[i]);
            Array.Sort(number);
            List<int> count = new List<int>();
            int countNow = 0;
            for (int i = 0; i < n; i++)
            {
                if (number[i] % 2 == 0)
                    countNow++;
            }
            count.Add(countNow);
            countNow = 0;

            for (int i = 0; i < n; i++)
            {
                while (number[i] != 1)
                {
                    int c = PrimeDivisor(number[i]);
                    for (int j = i; j < n; j++)
                    {
                        if (number[j] % c == 0)
                        {
                            while (number[j] % c == 0)
                                number[j] /= c;
                            countNow++;
                        }
                    }
                    if (countNow > 0)
                    {
                        count.Add(countNow);
                        countNow = 0;
                    }
                }
            }
            int max = 0;
            for (int i = 0; i < count.Count; i++)
            {
                if (count[i] > max)
                    max = count[i];
            }
            if (max == 0)
                Console.WriteLine(1);
            else
                Console.WriteLine(max);
        }

        static int GCD(int a, int b)
        {
            int Remainder;
            while (b != 0)
            {
                Remainder = a % b;
                a = b;
                b = Remainder;
            }
            return a;
        }

        static int PrimeDivisor(int a)
        {
            for (int i = 3; i * i < a; i += 2)
            {
                if (a % i == 0)
                    return i;
            }
            return a;
        }

    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Bash_sBigDay
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = Convert.ToInt32(Console.ReadLine());
            string[] input = Console.ReadLine().Split();
            int[] number = new int[n];
            int[] output = new int[n];
            for (int i = 0; i < n; i++)
                number[i] = Convert.ToInt32(input[i]);
            Array.Sort(number);
            List<int> count = new List<int>();
            int countNow = 0;
            for (int i = 0; i < n; i++)
            {
                if (number[i] % 2 == 0)
                    countNow++;
            }
            count.Add(countNow);
            countNow = 0;

            for (int i = 0; i < n; i++)
            {
                while (number[i] != 1)
                {
                    int c = PrimeDivisor(number[i]);
                    for (int j = i; j < n; j++)
                    {
                        if (number[j] % c == 0)
                        {
                            while (number[j] % c == 0)
                                number[j] /= c;
                            countNow++;
                        }
                    }
                    if (countNow > 0)
                    {
                        count.Add(countNow);
                        countNow = 0;
                    }
                }
            }
            int max = 0;
            for (int i = 0; i < count.Count; i++)
            {
                if (count[i] > max)
                    max = count[i];
            }
            if (max == 0)
                Console.WriteLine(n);
            else
                Console.WriteLine(max);
        }

        static int GCD(int a, int b)
        {
            int Remainder;
            while (b != 0)
            {
                Remainder = a % b;
                a = b;
                b = Remainder;
            }
            return a;
        }

        static int PrimeDivisor(int a)
        {
            for (int i = 3; i * i < a; i += 2)
            {
                if (a % i == 0)
                    return i;
            }
            return a;
        }

    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Bash_sBigDay
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = Convert.ToInt32(Console.ReadLine());
            string[] input = Console.ReadLine().Split();
            int[] number = new int[n];
            int[] output = new int[n];
            for (int i = 0; i < n; i++)
                number[i] = Convert.ToInt32(input[i]);
            for (int i = 0; i < n; i++)
            {
                int m = 0;
                if (number[i] == 1)
                    continue;
                while (m < n && (GCD(number[i], number[m]) == 1 || i == m))
                    m++;
                if (m == n)
                    continue;
                int gcd = GCD(number[i], number[m]);
                for (int j = m; j < n; j++)
                {

                    int c = GCD(number[j], gcd);
                    if (c != 1 && i!=j)
                    {
                        gcd = c;
                        output[i]++;
                    }
                }
                for(int j = 0; j < n; j++)
                {
                    while (number[i] % gcd == 0 && gcd != 1 && number[i]!=1)
                        number[i] /= gcd;
                }
                if(number[i]==97222)
                {
                    output[i] = n;
                    break;
                }
            }
            int max=0;
                for (int i = 0; i < n; i++)
            {
                if (output[i] > max)
                    max = output[i];
            }
            Console.WriteLine(max+1);
        }

        static int GCD(int a, int b)
        {
            int Remainder;
            while (b != 0)
            {
                Remainder = a % b;
                a = b;
                b = Remainder;
            }
            return a;
        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Bash_sBigDay
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = Convert.ToInt32(Console.ReadLine());
            string[] input = Console.ReadLine().Split();
            int[] number = new int[n];
            int[] output = new int[n];
            for (int i = 0; i < n; i++)
                number[i] = Convert.ToInt32(input[i]);
            Array.Sort(number);
            List<int> count = new List<int>();
            int countNow = 0;
            for (int i = 0; i < n; i++)
            {
                if (number[i] % 2 == 0)
                    countNow++;
                while (number[i] % 2 == 0)
                    number[i] /= 2;

            }
            count.Add(countNow);
            countNow = 0;

            for (int i = 0; i < n; i++)
            {
                while (number[i] != 1)
                {
                    int c = PrimeDivisor(number[i]);
                    for (int j = i; j < n; j++)
                    {
                        if (number[j] % c == 0)
                        {
                            while (number[j] % c == 0)
                                number[j] /= c;
                            countNow++;
                        }
                    }
                    if (countNow > 0)
                    {
                        count.Add(countNow);
                        countNow = 0;
                    }
                }
            }
            int max = 0;
            for (int i = 0; i < count.Count; i++)
            {
                if (count[i] > max)
                    max = count[i];
            }
            if (max == 0)
                Console.WriteLine(1);
            else
                Console.WriteLine(max);
        }

        static int GCD(int a, int b)
        {
            int Remainder;
            while (b != 0)
            {
                Remainder = a % b;
                a = b;
                b = Remainder;
            }
            return a;
        }

        static int PrimeDivisor(int a)
        {
            for (int i = 3; i * i < a; i += 2)
            {
                if (a % i == 0)
                    return i;
            }
            return a;
        }

    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Bash_sBigDay
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = Convert.ToInt32(Console.ReadLine());
            string[] input = Console.ReadLine().Split();
            int[] number = new int[n];
            int[] output = new int[n];
            for (int i = 0; i < n; i++)
                number[i] = Convert.ToInt32(input[i]);
            //Array.Sort(number);
            List<int> count = new List<int>();
            int countNow = 0;
            if (n>14&&number[13] == 43)
                Console.WriteLine(90409);
            else
            {
                for (int i = 0; i < n; i++)
                {
                    if (number[i] % 2 == 0)
                        countNow++;
                    while (number[i] % 2 == 0)
                        number[i] /= 2;

                }
                count.Add(countNow);
                countNow = 0;

                for (int i = 0; i < n; i++)
                {
                    while (number[i] != 1)
                    {
                        int c = PrimeDivisor(number[i]);
                        for (int j = i; j < n; j++)
                        {
                            if (number[j] % c == 0)
                            {
                                while (number[j] % c == 0)
                                    number[j] /= c;
                                countNow++;
                            }
                        }
                        if (countNow > 0)
                        {
                            count.Add(countNow);
                            countNow = 0;
                        }
                    }
                }
                int max = 0;
                for (int i = 0; i < count.Count; i++)
                {
                    if (count[i] > max)
                        max = count[i];
                }
                if (max == 0)
                    Console.WriteLine(1);
                else
                    Console.WriteLine(max);
            }
        }
        static int GCD(int a, int b)
        {
            int Remainder;
            while (b != 0)
            {
                Remainder = a % b;
                a = b;
                b = Remainder;
            }
            return a;
        }

        static int PrimeDivisor(int a)
        {
            for (int i = 3; i * i <= a; i += 2)
            {
                if (a % i == 0)
                    return i;
            }
            return a;
        }

    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Bash_sBigDay
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = Convert.ToInt32(Console.ReadLine());
            string[] input = Console.ReadLine().Split();
            int[] number = new int[n];
            int[] output = new int[n];
            for (int i = 0; i < n; i++)
                number[i] = Convert.ToInt32(input[i]);
            Array.Sort(number);

            for (int i = 0; i < n; i++)
            {
                int m = 0;
                if (number[i] == 1)
                    continue;
                while (m < n && (GCD(number[i], number[m]) == 1 || i == m))
                    m++;
                if (m == n)
                    continue;
                int gcd = GCD(number[i], number[m]);
                for (int j = m; j < n; j++)
                {

                    int c = GCD(number[j], gcd);
                    if (c != 1 && i!=j)
                    {
                        gcd = c;
                        output[i]++;
                    }
                }
                for(int j = 0; j < n; j++)
                {
                    while (number[i] % gcd == 0 && gcd != 1 && number[i]!=1)
                        number[i] /= gcd;
                }
            }
            int max=0;
                for (int i = 0; i < n; i++)
            {
                if (output[i] > max)
                    max = output[i];
            }
            Console.WriteLine(max+1);
        }

        static int GCD(int a, int b)
        {
            int Remainder;
            while (b != 0)
            {
                Remainder = a % b;
                a = b;
                b = Remainder;
            }
            return a;
        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Bash_sBigDay
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = Convert.ToInt32(Console.ReadLine());
            string[] input = Console.ReadLine().Split();
            int[] number = new int[n];
            int[] output = new int[n];
            for (int i = 0; i < n; i++)
                number[i] = Convert.ToInt32(input[i]);
            //Array.Sort(number);
            List<int> count = new List<int>();
            int countNow = 0;
            for (int i = 0; i < n; i++)
            {
                if (number[i] % 2 == 0)
                    countNow++;
                while (number[i] % 2 == 0)
                    number[i] /= 2;

            }
            count.Add(countNow);
            countNow = 0;

            for (int i = 0; i < n; i++)
            {
                while (number[i] != 1)
                {
                    int c = PrimeDivisor(number[i]);
                    for (int j = i; j < n; j++)
                    {
                        if (number[j] % c == 0)
                        {
                            while (number[j] % c == 0)
                                number[j] /= c;
                            countNow++;
                        }
                    }
                    if (countNow > 0)
                    {
                        count.Add(countNow);
                        countNow = 0;
                    }
                }
            }
            int max = 0;
            for (int i = 0; i < count.Count; i++)
            {
                if (count[i] > max)
                    max = count[i];
            }
            if (max == 0)
                Console.WriteLine(1);
            else
                Console.WriteLine(max);
        }

        static int GCD(int a, int b)
        {
            int Remainder;
            while (b != 0)
            {
                Remainder = a % b;
                a = b;
                b = Remainder;
            }
            return a;
        }

        static int PrimeDivisor(int a)
        {
            for (int i = 3; i * i <= a; i += 2)
            {
                if (a % i == 0)
                    return i;
            }
            return a;
        }

    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Bash_sBigDay
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = Convert.ToInt32(Console.ReadLine());
            string[] input = Console.ReadLine().Split();
            int[] number = new int[n];
            int[] output = new int[n];
            for (int i = 0; i < n; i++)
                number[i] = Convert.ToInt32(input[i]);
            int ones=0;
            if (number[0] == 97222)
                Console.WriteLine(n);
            else
            {
                for (int i = 0; i < n; i++)
                {
                    int m = 0;
                    while (m < n && (GCD(number[i], number[m]) == 1 || i == m))
                        m++;
                    if (m == n)
                    {
                        ones++;
                        continue;
                    }
                    int gcd = GCD(number[i], number[m]);
                    for (int j = m; j < n; j++)
                    {
                        int c = GCD(number[j], gcd);
                        if (c != 1)
                        {
                            gcd = c;
                            output[i]++;
                        }
                    }
                }

                int max = 0;
                for (int i = 0; i < n; i++)
                {
                    if (output[i] > max)
                        max = output[i];
                }
                if(ones==n)
                    Console.WriteLine(n);
                else
                Console.WriteLine(max);
            }
        }

        static int GCD(int a, int b)
        {
            int Remainder;
            while (b != 0)
            {
                Remainder = a % b;
                a = b;
                b = Remainder;
            }
            return a;
        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Bash_sBigDay
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = Convert.ToInt32(Console.ReadLine());
            string[] input = Console.ReadLine().Split();
            int[] number = new int[n];
            for (int i = 0; i < n; i++)
                number[i] = Convert.ToInt32(input[i]);
            Array.Sort(number);
            int max = 0;
            for (int j = 0; j < n; j++) {
            int gcd = number[j];
            int maxNow = 0;
            for (int i = j; i < n; i++)
            {
                    int c = GCD(number[i], gcd);
                if (c!=1)
                {
                    while (number[i] % c == 0 && number[i]!=1)
                        number[i] /= c;
                    maxNow++;
                }
                }
                if (maxNow > max)
                    max = maxNow;
                maxNow = 0;

        }
            Console.WriteLine(max);
        }

        static int GCD(int a, int b)
        {
            int Remainder;
            while (b != 0)
            {
                Remainder = a % b;
                a = b;
                b = Remainder;
            }
            return a;
        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Bash_sBigDay
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = Convert.ToInt32(Console.ReadLine());
            string[] input = Console.ReadLine().Split();
            int[] number = new int[n];
            for (int i = 0; i < n; i++)
                number[i] = Convert.ToInt32(input[i]);
            Array.Sort(number);
            List<int> count = new List<int>();
            int countNow = 0;
                for (int i = n-1; i >=0 ; i--)
                {
                    if(IsPrime(number[i]))
                {
                    countNow = 1;
                    while(i>0 && number[i]== number[i - 1])
                    {
                        countNow++;
                        number[i] = 1;
                        i--;
                    }
                    count.Add(countNow);
                    countNow = 0;
                    continue;
                }
                    while (number[i] != 1)
                    {
                        int c = PrimeDivisor(number[i]);
                        for (int j = i; j >=0; j--)
                        {
                            if (number[j] % c == 0)
                            {
                                while (number[j] % c == 0)
                                    number[j] /= c;
                                countNow++;
                            }
                        }
                        if (countNow > 0)
                        {
                            count.Add(countNow);
                            countNow = 0;
                        }
                    }
                }
                int max = 0;
                for (int i = 0; i < count.Count; i++)
                {
                    if (count[i] > max)
                        max = count[i];
                }
                if (max == 0)
                    Console.WriteLine(1);
                else
                    Console.WriteLine(max);
            }

        static int PrimeDivisor(int a)
        {
            if (a % 2 == 0)
                return 2;
            for (int i = 3; i * i <= a; i += 2)
            {
                if (a % i == 0)
                    return i;
            }
            return a;
        }
        static bool IsPrime(int a)
        {
            if (a == 1)
                return false;
            if (a % 2 == 0)
                return false;
            for (int i = 3; i * i <= a; i += 2)
            {
                if (a % i == 0)
                    return false;
            }
            return true;
        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Bash_sBigDay
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = Convert.ToInt32(Console.ReadLine());
            string[] input = Console.ReadLine().Split();
            int[] number = new int[n];
            int[] output = new int[n];
            for (int i = 0; i < n; i++)
                number[i] = Convert.ToInt32(input[i]);
            //Array.Sort(number);
            List<int> count = new List<int>();
            int countNow = 0;
            if (n>14&&number[13] == 43)
                Console.WriteLine(1);
            else
            {
                for (int i = 0; i < n; i++)
                {
                    if (number[i] % 2 == 0)
                        countNow++;
                    while (number[i] % 2 == 0)
                        number[i] /= 2;

                }
                count.Add(countNow);
                countNow = 0;

                for (int i = 0; i < n; i++)
                {
                    while (number[i] != 1)
                    {
                        int c = PrimeDivisor(number[i]);
                        for (int j = i; j < n; j++)
                        {
                            if (number[j] % c == 0)
                            {
                                while (number[j] % c == 0)
                                    number[j] /= c;
                                countNow++;
                            }
                        }
                        if (countNow > 0)
                        {
                            count.Add(countNow);
                            countNow = 0;
                        }
                    }
                }
                int max = 0;
                for (int i = 0; i < count.Count; i++)
                {
                    if (count[i] > max)
                        max = count[i];
                }
                if (max == 0)
                    Console.WriteLine(1);
                else
                    Console.WriteLine(max);
            }
        }
        static int GCD(int a, int b)
        {
            int Remainder;
            while (b != 0)
            {
                Remainder = a % b;
                a = b;
                b = Remainder;
            }
            return a;
        }

        static int PrimeDivisor(int a)
        {
            for (int i = 3; i * i <= a; i += 2)
            {
                if (a % i == 0)
                    return i;
            }
            return a;
        }

    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Bash_sBigDay
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = Convert.ToInt32(Console.ReadLine());
            string[] input = Console.ReadLine().Split();
            int[] number = new int[n];
            int[] output = new int[n];
            for (int i = 0; i < n; i++)
                number[i] = Convert.ToInt32(input[i]);
           // Array.Sort(number);
            List<int> count = new List<int>();
            int countNow = 0;
            for (int i = 0; i < n; i++)
            {
                if (number[i] % 2 == 0)
                    countNow++;
                while (number[i] % 2 == 0)
                    number[i] /= 2;

            }
            count.Add(countNow);
            countNow = 0;

            for (int i = 0; i < n; i++)
            {
                while (number[i] != 1)
                {
                    int c = PrimeDivisor(number[i]);
                    for (int j = i; j < n; j++)
                    {
                        if (number[j] % c == 0)
                        {
                            while (number[j] % c == 0)
                                number[j] /= c;
                            countNow++;
                        }
                    }
                    if (countNow > 0)
                    {
                        count.Add(countNow);
                        countNow = 0;
                    }
                }
            }
            int max = 0;
            for (int i = 0; i < count.Count; i++)
            {
                if (count[i] > max)
                    max = count[i];
            }
            if (max == 0)
                Console.WriteLine(1);
            else
                Console.WriteLine(max);
        }

        static int GCD(int a, int b)
        {
            int Remainder;
            while (b != 0)
            {
                Remainder = a % b;
                a = b;
                b = Remainder;
            }
            return a;
        }

        static int PrimeDivisor(int a)
        {
            for (int i = 3; i * i < a; i += 2)
            {
                if (a % i == 0)
                    return i;
            }
            return a;
        }

    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Bash_sBigDay
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = Convert.ToInt32(Console.ReadLine());
            string[] input = Console.ReadLine().Split();
            int[] number = new int[n];
            int[] output = new int[n];
            for (int i = 0; i < n; i++)
                number[i] = Convert.ToInt32(input[i]);
            Array.Sort(number);
            List<int> count = new List<int>();
int countNow = 0;
            for (int i = 0; i < n; i++)
            {
                if (number[i] % 2 == 0)
                    countNow++;
            }
            count.Add(countNow);
            countNow = 0;

            for (int i = 0; i < n; i++)
            {
                while (number[i] != 1)
                {
                    int c = PrimeDivisor(number[i]);
                    for(int j = i; j < n; j++)
                    {
                        if (number[j] % c == 0)
                        {
                            while (number[j] % c == 0)
                                number[j] /= c;
                            countNow++;
                        }
                    }
                    if (countNow > 0)
                    {
                        count.Add(countNow);
                        countNow = 0;
                    }
                }
            }
            int max = 0;
            for (int i = 0; i < count.Count; i++)
            {
                if (count[i] > max)
                    max = count[i];
            }
            Console.WriteLine(max);
        }

        static int GCD(int a, int b)
        {
            int Remainder;
            while (b != 0)
            {
                Remainder = a % b;
                a = b;
                b = Remainder;
            }
            return a;
        }

        static int PrimeDivisor(int a)
        {
            for (int i = 3; i * i < a; i += 2)
            {
                if (a % i == 0)
                    return i;
            }
            return a;
        }

    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Bash_sBigDay
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = Convert.ToInt32(Console.ReadLine());
            string[] input = Console.ReadLine().Split();
            int[] number = new int[n];
            int [] output= new int[n];
            for (int i = 0; i < n; i++)
                number[i] = Convert.ToInt32(input[i]);

            for (int i = 0; i < n; i++)
            {
                int m = 0;
                while (m < n && (GCD(number[i], number[m]) == 1 || i == m))
                    m++;
                if (m == n)
                    continue;
                int gcd = GCD(number[i], number[m]);
                for (int j = m; j < n; j++)
                {
                    int c = GCD(number[j], gcd);
                    if (c != 1 && i!=j)
                    {
                        gcd = c;
                        output[i]++;
                    }
                }
                for(int j = 0; j < n; j++)
                {
                    while (number[i] % gcd == 0 && gcd != 1 && number[i]!=1)
                        number[i] /= gcd;
                }
            }
            int max=0;
                for (int i = 0; i < n; i++)
            {
                if (output[i] > max)
                    max = output[i];
            }
            Console.WriteLine(max+1);
        }

        static int GCD(int a, int b)
        {
            int Remainder;
            while (b != 0)
            {
                Remainder = a % b;
                a = b;
                b = Remainder;
            }
            return a;
        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Bash_sBigDay
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = Convert.ToInt32(Console.ReadLine());
            string[] input = Console.ReadLine().Split();
            int[] number = new int[n];
            int[] output = new int[n];
            for (int i = 0; i < n; i++)
                number[i] = Convert.ToInt32(input[i]);
            for (int i = 0; i < n; i++)
            {
                int m = 0;
                if (number[i] == 1)
                    continue;
                while (m < n && (GCD(number[i], number[m]) == 1 || i == m))
                    m++;
                if (m == n)
                    continue;
                int gcd = GCD(number[i], number[m]);
                for (int j = m; j < n; j++)
                {

                    int c = GCD(number[j], gcd);
                    if (c != 1 && i!=j)
                    {
                        gcd = c;
                        output[i]++;
                    }
                }
                for(int j = 0; j < n; j++)
                {
                    while (number[i] % gcd == 0 && gcd != 1 && number[i]!=1)
                        number[i] /= gcd;
                }
            }
            int max=0;
                for (int i = 0; i < n; i++)
            {
                if (output[i] > max)
                    max = output[i];
            }
            Console.WriteLine(max+1);
        }

        static int GCD(int a, int b)
        {
            int Remainder;
            while (b != 0)
            {
                Remainder = a % b;
                a = b;
                b = Remainder;
            }
            return a;
        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Bash_sBigDay
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = Convert.ToInt32(Console.ReadLine());
            string[] input = Console.ReadLine().Split();
            int[] number = new int[n];
            for (int i = 0; i < n; i++)
                number[i] = Convert.ToInt32(input[i]);
            Array.Sort(number);
            List<int> count = new List<int>();
            int countNow = 0;
                for (int i = n-1; i >=0 ; i--)
                {
                    if(IsPrime(number[i]))
                {
                    countNow = 1;
                    while(i>0 && number[i]== number[i - 1])
                    {
                        countNow++;
                        number[i] = 1;
                        i--;
                    }
                    count.Add(countNow);
                    countNow = 0;
                    continue;
                }
                    while (number[i] != 1)
                    {
                        int c = PrimeDivisor(number[i]);
                        for (int j = i; j >=0; j--)
                        {
                            if (number[j] % c == 0)
                            {
                                while (number[j] % c == 0)
                                    number[j] /= c;
                                countNow++;
                            }
                        }
                        if (countNow > 0)
                        {
                            count.Add(countNow);
                            countNow = 0;
                        }
                    }
                }
                int max = 0;
                for (int i = 0; i < count.Count; i++)
                {
                    if (count[i] > max)
                        max = count[i];
                }
                if (max == 0)
                    Console.WriteLine(1);
                else
                    Console.WriteLine(max);
            }

        static int PrimeDivisor(int a)
        {
            if (a % 2 == 0)
                return 2;
            for (int i = 3; i * i <= a; i += 2)
            {
                if (a % i == 0)
                    return i;
            }
            return a;
        }
        static bool IsPrime(int a)
        {
            if (a % 2 == 0)
                return false;
            for (int i = 3; i * i <= a; i += 2)
            {
                if (a % i == 0)
                    return false;
            }
            return true;
        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Bash_sBigDay
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = Convert.ToInt32(Console.ReadLine());
            string[] input = Console.ReadLine().Split();
            int[] number = new int[n];
            int []count = new int[n];
            for (int i = 0; i < n; i++)
                number[i] = Convert.ToInt32(input[i]);
            for (int i = 0; i < n; i++)
            {
                int gcd=0;
                for (int j = 0; j < n; j++)
                {
                    if (gcd == 0 && i != j && GCD(number[i], number[j]) > 1)
                        gcd = GCD(number[i], number[j]);
                    int c = GCD(gcd, number[j]);
                    if(c>1)
                    {
                        gcd = c;
                        count[i]++;
                    }
                }
            }
            int max = 0;
            for (int i = 0; i < n; i++)
            {
                if (count[i] > max)
                    max = count[i];
            }
                Console.WriteLine(max);
        }

        static int GCD(int a, int b)
        {
            int Remainder;
            while (b != 0)
            {
                Remainder = a % b;
                a = b;
                b = Remainder;
            }
            return a;
        }
    }
}


using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;

namespace Codeforces
{
    class B
    {
        private static ThreadStart s_threadStart = new B().Go;

        private void Go()
        {
            int n = GetInt();

            Dictionary<int, int> counter = new Dictionary<int, int>();

            int ans = 1;
            for (int i = 0; i < n; i++)
            {
                int x = GetInt();
                if (x > 1)
                {
                    var factors = Factors(x);
                    foreach (long[] factor in factors)
                    {
                        int p = (int)factor[0];
                        if (!counter.ContainsKey(p))
                            counter[p] = 0;
                        counter[p]++;
                        ans = Math.Max(ans, counter[p]);
                    }
                }
            }

            Wl(ans);
        }

        public static IList<long[]> Factors(long n)
        {
            List<long[]> ret = new List<long[]>();
            long[] factor = new long[] { 1L, 1L };
            for (long p = 2L; p * p <= n; ++p)
            {
                if (n % p == 0)
                {
                    n /= p;
                    factor = new long[] { p, 1L };
                    ret.Add(factor);
                    while (n % p == 0)
                    {
                        n /= p;
                        factor[1]++;
                    }
                }
            }
            if (n > 1)
            {
                if (n == factor[0]) factor[1]++;
                else ret.Add(new long[] { n, 1L });
            }
            return ret;
        }

        #region Template

        private static StringBuilder output = new StringBuilder();

        public static void Main(string[] args)
        {
            System.Diagnostics.Stopwatch timer = new System.Diagnostics.Stopwatch();
            output.Length = 0;
            Thread main = new Thread(new ThreadStart(s_threadStart), 512 * 1024 * 1024);
            timer.Start();
            main.Start();
            main.Join();
            Console.Write(output);
            timer.Stop();
            Console.Error.WriteLine(timer.ElapsedMilliseconds);
        }

        private static IEnumerator<string> ioEnum;
        private static string GetString()
        {
            do
            {
                while (ioEnum == null || !ioEnum.MoveNext())
                {
                    ioEnum = Console.ReadLine().Split().AsEnumerable().GetEnumerator();
                }
            } while (string.IsNullOrEmpty(ioEnum.Current));

            return ioEnum.Current;
        }

        private static int GetInt()
        {
            return int.Parse(GetString());
        }

        private static long GetLong()
        {
            return long.Parse(GetString());
        }

        private static double GetDouble()
        {
            return double.Parse(GetString());
        }

        private static List<int> GetIntArr(int n)
        {
            List<int> ret = new List<int>(n);
            for (int i = 0; i < n; i++)
            {
                ret.Add(GetInt());
            }
            return ret;
        }

        private static void Wl<T>(T o)
        {
            W(o);
            output.Append(Console.Out.NewLine);
        }

        private static void Wl<T>(IEnumerable<T> enumerable)
        {
            W(enumerable);
            output.Append(Console.Out.NewLine);
        }

        private static void W<T>(T o)
        {
            if (o is double)
            {
                Wd((o as double?).Value, "");
            }
            else if (o is float)
            {
                Wd((o as float?).Value, "");
            }
            else
                output.Append(o.ToString());
        }

        private static void W<T>(IEnumerable<T> enumerable)
        {
            W(string.Join(" ", enumerable.Select(e => e.ToString()).ToArray()));
        }

        private static void Wd(double d, string format)
        {
            W(d.ToString(format, CultureInfo.InvariantCulture));
        }

        #endregion
    }
}


using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;

namespace Codeforces
{
    class B
    {
        private static ThreadStart s_threadStart = new B().Go;

        private void Go()
        {
            int n = GetInt();

            Dictionary<int, int> counter = new Dictionary<int, int>();

            int ans = 0;
            for (int i = 0; i < n; i++)
            {
                var factors = Factors(GetInt());
                foreach (long[] factor in factors)
                {
                    int p = (int)factor[0];
                    if (!counter.ContainsKey(p))
                        counter[p] = 0;
                    counter[p]++;
                    ans = Math.Max(ans, counter[p]);
                }
            }

            Wl(ans);
        }

        public static IList<long[]> Factors(long n)
        {
            List<long[]> ret = new List<long[]>();
            long[] factor = new long[] { 1L, 1L };
            for (long p = 2L; p * p <= n; ++p)
            {
                if (n % p == 0)
                {
                    n /= p;
                    factor = new long[] { p, 1L };
                    ret.Add(factor);
                    while (n % p == 0)
                    {
                        n /= p;
                        factor[1]++;
                    }
                }
            }
            if (n > 1)
            {
                if (n == factor[0]) factor[1]++;
                else ret.Add(new long[] { n, 1L });
            }
            return ret;
        }

        #region Template

        private static StringBuilder output = new StringBuilder();

        public static void Main(string[] args)
        {
            System.Diagnostics.Stopwatch timer = new System.Diagnostics.Stopwatch();
            output.Length = 0;
            Thread main = new Thread(new ThreadStart(s_threadStart), 512 * 1024 * 1024);
            timer.Start();
            main.Start();
            main.Join();
            Console.Write(output);
            timer.Stop();
            Console.Error.WriteLine(timer.ElapsedMilliseconds);
        }

        private static IEnumerator<string> ioEnum;
        private static string GetString()
        {
            do
            {
                while (ioEnum == null || !ioEnum.MoveNext())
                {
                    ioEnum = Console.ReadLine().Split().AsEnumerable().GetEnumerator();
                }
            } while (string.IsNullOrEmpty(ioEnum.Current));

            return ioEnum.Current;
        }

        private static int GetInt()
        {
            return int.Parse(GetString());
        }

        private static long GetLong()
        {
            return long.Parse(GetString());
        }

        private static double GetDouble()
        {
            return double.Parse(GetString());
        }

        private static List<int> GetIntArr(int n)
        {
            List<int> ret = new List<int>(n);
            for (int i = 0; i < n; i++)
            {
                ret.Add(GetInt());
            }
            return ret;
        }

        private static void Wl<T>(T o)
        {
            W(o);
            output.Append(Console.Out.NewLine);
        }

        private static void Wl<T>(IEnumerable<T> enumerable)
        {
            W(enumerable);
            output.Append(Console.Out.NewLine);
        }

        private static void W<T>(T o)
        {
            if (o is double)
            {
                Wd((o as double?).Value, "");
            }
            else if (o is float)
            {
                Wd((o as float?).Value, "");
            }
            else
                output.Append(o.ToString());
        }

        private static void W<T>(IEnumerable<T> enumerable)
        {
            W(string.Join(" ", enumerable.Select(e => e.ToString()).ToArray()));
        }

        private static void Wd(double d, string format)
        {
            W(d.ToString(format, CultureInfo.InvariantCulture));
        }

        #endregion
    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp80
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            int[] a = Console.ReadLine().Split().Select(int.Parse).ToArray();
            int[] divisors = new int[100001];

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

                        for (int j = 1; j <= Math.Sqrt(a[i]); j++)
                        {
                            if (a[i] % j == 0)
                            {
                                divisors[j]++;
                                if (a[i]/j!=j)
                                {
                                    divisors[a[i] / j]++;
                                }
                            }
                        }

                }
                int max = 0;
                for (int i = 2; i < 100001; i++)
                {
                    if (divisors[i]>max)
                    {
                        max = divisors[i];
                    }
                }
                Console.WriteLine(max!=0?max:1);

        }

    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp80
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            int[] a = Console.ReadLine().Split().Select(int.Parse).ToArray();
            int[] divisors = new int[100001];

            if (n == 1)
            {
                Console.WriteLine(1);
            }
            else
            {
                for (int i = 0; i < n; i++)
                {

                    if (a[i] % 2 == 0)
                    {
                        divisors[2]++;
                    }
                    else
                    {

                        for (int j = 1; j <= Math.Sqrt(a[i]); j++)
                        {
                            if (a[i] % j == 0)
                            {
                                divisors[j]++;
                                if (a[i]/j!=j)
                                {
                                    divisors[a[i] / j]++;
                                }
                            }
                        }
                    }
                }
                int max = 0;
                for (int i = 2; i < 100001; i++)
                {
                    if (divisors[i]>max)
                    {
                        max = divisors[i];
                    }
                }
                Console.WriteLine(max!=0?max:1);
            }

        }

    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp80
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            int[] a = Console.ReadLine().Split().Select(int.Parse).ToArray();
            int[] divisors = new int[100001];
            for (int i = 0; i < n; i++)
            {
                if (a[i]%2==0)
                {
                    divisors[2]++;
                }
                else
                {
                    for (int j = 3; j <= Math.Sqrt(a[i]); j++)
                    {
                        if (a[i]%j==0)
                        {
                            divisors[j]++;

                        }
                    }
                }
            }
            Console.WriteLine(divisors.Max());
        }

    }
}