Let's call the roundness of the number the number of zeros to which it ends.

You have an array of n numbers. You need to choose a subset of exactly k numbers so that the roundness of the product of the selected numbers will be maximum possible.

Input

The first line contains two integer numbers n and k (1 ≤ n ≤ 200, 1 ≤ k ≤ n).

The second line contains n space-separated integer numbers a1, a2, ..., an (1 ≤ ai ≤ 1018).

Output

Print maximal roundness of product of the chosen subset of length k.

Examples

Input

3 2
50 4 20


Output

3


Input

5 3
15 16 3 25 9


Output

3


Input

3 3
9 77 13


Output

0

Note

In the first example there are 3 subsets of 2 numbers. [50, 4] has product 200 with roundness 2, [4, 20] — product 80, roundness 1, [50, 20] — product 1000, roundness 3.

In the second example subset [15, 16, 25] has product 6000, roundness 3.

In the third example all subsets has product with roundness 0.
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

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

    static class TaskD {
        int[] t;
        int[] f;
        int[][][] dp;
        int n;
        int k;

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

            n = in.nextInt();
            k = in.nextInt();
            t = new int[n + 1];
            f = new int[n + 1];
            dp = new int[2][k + 1][n * 30];

            for (int i = 1; i <= n; ++i) {
                long x = in.nextLong();
                while (x % 2 == 0) {
                    x /= 2;
                    t[i]++;
                }
                while (x % 5 == 0) {
                    x /= 5;
                    f[i]++;
                }
            }

            for (int i = 0; i <= k; ++i) {
                Arrays.fill(dp[0][i], -30 * n);
                Arrays.fill(dp[1][i], -30 * n);
            }

            int e5 = 0;
            int cur = 0, nxt = 1;
            dp[cur][0][0] = 0;

            for (int i = 1; i <= n; ++i) {
                for (int kk = 0; kk <= Math.min(k, i); ++kk) {
                    for (int jj = 0; jj <= e5; ++jj) {
                        if (kk < k)
                            dp[nxt][kk + 1][jj + f[i]] = Math.max(dp[nxt][kk + 1][jj + f[i]], dp[cur][kk][jj] + t[i]);
                        dp[nxt][kk][jj] = Math.max(dp[nxt][kk][jj], dp[cur][kk][jj]);
                    }
                }

//            for(int x = 0; x <= k; ++x) {
//                for (int j = 0; j <= e5 + 10; ++j)
//                    out.print(dp[nxt][x][j] + " ");
//                out.println();
//            }
//
//            out.println();

                e5 += f[i];

                for (int r = 0; r <= k; ++r)
                    Arrays.fill(dp[cur][r], -30 * n);

                cur ^= 1;
                nxt ^= 1;
            }


            int ans = 0;
            for (int i = 0; i <= e5; ++i)
                ans = Math.max(ans, Math.min(i, dp[cur][k][i]));

            out.println(ans);
        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

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

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

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

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

    }
}

