#include <bits/stdc++.h>
const int maxn = 200 + 10;
const int maxm = 4e5 + 10;
const int inf = 0x3f3f3f3f;
const long long mod = 1e9 + 7;
const double eps = 1e-7;
using namespace std;
int n, k;
long long a[maxn];
int cnt2[maxn], cnt5[maxn];
int dp[maxn][maxn * 30];
int cnt = 0;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> k;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    while (a[i] % 2 == 0) a[i] /= 2, cnt2[i]++;
    while (a[i] % 5 == 0) a[i] /= 5, cnt5[i]++, cnt++;
  }
  for (int i = 0; i < maxn; i++)
    for (int j = 0; j < 30 * maxn; j++) dp[i][j] = -1;
  dp[0][0] = 0;
  for (int i = 1; i <= n; i++) {
    for (int j = min(k, i); j >= 1; j--) {
      for (int p = cnt; p >= max(cnt5[i], 0); p--)
        if (dp[j - 1][p - cnt5[i]] != -1)
          dp[j][p] = max(dp[j][p], dp[j - 1][p - cnt5[i]] + cnt2[i]);
    }
  }
  int ans = 0;
  for (int i = 0; i <= cnt; i++) ans = max(ans, min(dp[k][i], i));
  cout << ans;
  return ~~(0 - 0);
}
