#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const int maxn = 1e5 + 5;
long long dp[205][15005];
long long p2[205], p5[205];
long long a[205];
int n, k;
int main() {
  cin >> n >> k;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    while (a[i] % 2 == 0) a[i] /= 2, p2[i]++;
    while (a[i] % 5 == 0) a[i] /= 5, p5[i]++;
  }
  memset(dp, -0x3f3f3f3f, sizeof(dp));
  dp[0][0] = 0;
  for (int i = 1; i <= n; i++) {
    for (int j = k; j >= 1; j--) {
      for (int k = 12005; k >= p2[i]; k--) {
        dp[j][k] = max(dp[j][k], dp[j - 1][k - p2[i]] + p5[i]);
      }
    }
  }
  long long mx = 0;
  for (long long i = 0; i <= 12005; i++) {
    mx = max(mx, min(i, dp[k][i]));
  }
  printf("%lld\n", mx);
  return 0;
}
