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.
#include <bits/stdc++.h>
using namespace std;
const int N = 209;
int dp[N][5001][2], temp[N][5001][2];
int n, k;
int cnt2[N], cnt5[N], cnt[N];
const int oo = (1e9);
const int num_max = 5000;
int main() {
  scanf("%d %d", &n, &k);
  for (int i = 1; i <= n; i++) {
    long long a;
    scanf("%I64d", &a);
    cnt2[i] = cnt5[i] = 0;
    if (a == 0) continue;
    while (a % 2 == 0) {
      cnt2[i]++;
      a /= 2;
    }
    while (a % 5 == 0) {
      cnt5[i]++;
      a /= 5;
    }
    cnt[i] = min(cnt2[i], cnt5[i]);
    cnt2[i] -= cnt[i];
    cnt5[i] -= cnt[i];
  }
  int ans = -oo;
  for (int t = 0; t <= k; t++)
    for (int i = 0; i <= num_max; i++) {
      dp[t][i][0] = dp[t][i][1] = -oo;
      temp[t][i][0] = temp[t][i][1] = -oo;
    }
  dp[0][0][0] = dp[0][0][0] = 0;
  temp[0][0][0] = temp[0][0][0] = 0;
  for (int i = 1; i <= n; i++) {
    for (int t = 0; t <= k; t++)
      for (int j = 0; j <= num_max; j++) {
        dp[t][j][0] = max(dp[t][j][0], temp[t][j][0]);
        dp[t][j][1] = max(dp[t][j][1], temp[t][j][1]);
        if (t == 0) continue;
        if (cnt2[i]) {
          int jj = j + cnt2[i];
          if (jj > num_max) jj = num_max;
          dp[t][jj][0] = max(dp[t][jj][0], temp[t - 1][j][0] + cnt[i]);
          jj = j - cnt2[i];
          if (jj >= 0) {
            dp[t][jj][1] =
                max(dp[t][jj][1], temp[t - 1][j][1] + cnt2[i] + cnt[i]);
          } else {
            jj = abs(jj);
            dp[t][jj][0] = max(dp[t][jj][0], temp[t - 1][j][1] + j + cnt[i]);
          }
        } else {
          int jj = j + cnt5[i];
          if (jj > num_max) jj = num_max;
          dp[t][jj][1] = max(dp[t][jj][1], temp[t - 1][j][1] + cnt[i]);
          jj = j - cnt5[i];
          if (jj >= 0) {
            dp[t][jj][0] =
                max(dp[t][jj][0], temp[t - 1][j][0] + cnt5[i] + cnt[i]);
          } else {
            jj = abs(jj);
            dp[t][jj][1] = max(dp[t][jj][1], temp[t - 1][j][0] + j + cnt[i]);
          }
        }
      }
    for (int t = 0; t <= k; t++)
      for (int j = 0; j <= num_max; j++) {
        if (t == k) {
          ans = max(ans, dp[t][j][0]);
          ans = max(ans, dp[t][j][1]);
        }
        temp[t][j][0] = dp[t][j][0];
        temp[t][j][1] = dp[t][j][1];
        dp[t][j][0] = -oo;
        dp[t][j][1] = -oo;
      }
  }
  printf("%d", ans);
}
