#include <bits/stdc++.h>
using namespace std;
const int MAXN = 201;
const int LIMIT = 25 * MAXN;
int n, k;
int dp[2][MAXN][LIMIT];
long long arr[MAXN];
long long powOf(long long n, long long d) {
  long long res = 0;
  while (n % d == 0) {
    n /= d;
    res++;
  }
  return res;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n >> k;
  for (int i = 1; i <= n; i++) {
    cin >> arr[i];
  }
  memset(dp, -1, sizeof dp);
  dp[0][0][0] = 0;
  for (int i = 1; i <= n; i++) {
    int curr = i & 1;
    for (int j = 0; j < MAXN; j++) {
      for (int k = 0; k < LIMIT; k++) dp[curr][j][k] = -1;
    }
    int c2 = powOf(arr[i], 2ll);
    int c5 = powOf(arr[i], 5ll);
    int upper = min(k, i);
    dp[curr][0][0] = 0;
    for (int j = 1; j <= upper; j++) {
      int LIMIT = 1 + i * 25;
      for (int num5 = 0; num5 < LIMIT; num5++) {
        if (num5 >= c5 && dp[1 - curr][j - 1][num5 - c5] >= 0)
          dp[curr][j][num5] = dp[1 - curr][j - 1][num5 - c5] + c2;
        dp[curr][j][num5] = max(dp[curr][j][num5], dp[1 - curr][j][num5]);
      }
    }
  }
  int res = 0;
  for (int num5 = 0; num5 < LIMIT; num5++) {
    if (dp[n & 1][k][num5] > 0) {
      res = max(res, min(dp[n & 1][k][num5], num5));
    }
  }
  cout << res << '\n';
  return 0;
}
