#include <bits/stdc++.h>
using namespace std;
const int N = 205;
int c2[N], c5[N];
long long a[N];
int n, k;
long long ans = 0, dp[N][10005];
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; ++i) {
    scanf("%lld", &a[i]);
    while (a[i] % 2 == 0 && a[i]) {
      ++c2[i];
      a[i] /= 2;
    }
    while (a[i] % 5 == 0 && a[i]) {
      ++c5[i];
      a[i] /= 5;
    }
  }
  memset(dp, -1, sizeof(dp));
  dp[0][0] = 0;
  for (int i = 1; i <= n; ++i) {
    for (int j = k; j; --j) {
      for (int l = 10000; l >= c5[i]; --l) {
        if (dp[j - 1][l - c5[i]] != -1)
          dp[j][l] = max(dp[j][l], dp[j - 1][l - c5[i]] + c2[i]);
      }
    }
  }
  for (int i = 0; i <= 10000; ++i) {
    ans = max(ans, min((long long)(i), dp[k][i]));
  }
  printf("%lld\n", ans);
  return 0;
}
