import java.io.*;
import java.math.BigInteger;
import java.util.*;
import java.util.StringTokenizer;
import java.util.function.ToIntBiFunction;

public class Mark {

    public static void main(String[] args) throws IOException {
        FastReader fr = new FastReader();
        PrintWriter pw = new PrintWriter(System.out);

        int N = fr.nextInt();
        boolean t = true, f = true;

        for (int i = 0; i < N; ++i)
        {
            int a = fr.nextInt();
            t &= a % 2 == 0;
            f &= a % 5 == 0;
        }

        if (t || f)
            pw.println(N);
        else
            pw.println(1);

        pw.close();
    }

    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            br = new BufferedReader(new
                    InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            st = null;
            return str;
        }
    }

}