/*
* Author: Geeza
*/

#include <bits/stdc++.h>

#define ld long double
#define ll long long
#define pb push_back
#define fin(a, n) for(int i = a; i < n; i++)
#define fjn(a, n) for(int j = a; j < n; j++)
#define all(a) a.begin(),a.end()
#define allr(a) a.rbegin(),a.rend()
#define FAST ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr)

using namespace std;

const double PI = acos(-1);
const int N = 1e5+5;
const ll oo = 0x3f3f3f3f3f3f3f3f;
const int mod = 1000000007, inf = 1e6;

string di[] = {"D","L", "U", "R", "UL", "UR", "DL", "DR"};
int dx[] = {+1, +0, +0, -1, -1, -1, +1, +1};
int dy[] = {+0, -1, +1, +0, -1, +1, -1, +1};
char dc[] = {'D', 'L', 'R', 'U'};

ll n, k;
vector<ll> v;
map<ll, pair<ll, ll>> mp;

ll dp[205][205];

ll calc(int idx, int rem, ll twos, ll fives) {
    if (rem == 0) return 0;
    if (idx == n) return -oo;

    ll &ret = dp[idx][rem];
    if (~ret) return ret;
    ret = calc(idx+1, rem, twos, fives);
    
}

void solve() {
    cin >> n >> k;
    v.assign(n, 0);
    fin(0, n) cin >> v[i];

    fin(0, n) {
        ll tmp = v[i];
        bool good = true;
        while (good && tmp > 0) {
            if (tmp%2 == 0) {
                mp[v[i]].first++;
                tmp /= 2;
                continue;
            }
            if (tmp%5 == 0) {
                mp[v[i]].second++;
                tmp  /= 5;
                continue;
            }
            good = false;
        }
    }

    memset(dp, -1, sizeof dp);
    cout << calc(0, k, 0, 0) << "\n";
}

int main() {
    FAST;
#ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
#endif
    int tt = 1; //cin >> tt;
    while(tt--){
        solve();
    }
    return 0;
}