#include <iostream>
#include <string>
#include <cstdio>
#include <fstream>
using namespace std;
ifstream fin("cjzd.in");
ofstream fout("cjzd.out");
#define cin fin
#define cout fout
const long long MAXN(50), MAXK(10);
long long n, k, dp[MAXN][MAXK];
string num;
inline long long tonumber(string);
main()
{
// cout << sizeof(dp) / 1024.0;
cin >> n >> k >> num;
fin.close();
dp[0][0] = tonumber(num.substr(0, 1));
for (long long i = 1; i < n; ++i)
for (long long j = 0; j <= min(i, k); ++j)
if (j == 0)
dp[i][j] = tonumber(num.substr(0, i + 1));
else if (j == 1)
dp[i][j] = dp[i - 1][j - 1];
else
for (long long l = 0; l < i; ++l)
dp[i][j]=max(dp[i][j],dp[l][j-1]*tonumber(num.substr(l,
i-l)));
for (long i = k; i < n; ++i)
dp[n][k] = max(dp[i][k] * tonumber(num.substr(i, n - i)), dp[n][k]);
cout << dp[n][k];
fout.close();
// for (; ; );
}
inline long long tonumber(string s){
long long x = 0;
for (int i = 0; i < s.length(); ++i)
x = x * 10 + s[i] - '0';
return x;
}