#include<bits/stdc++.h>
#define int long long
using namespace std;
const int N=20;
int a[N];
int res=0;
int n,k;
void dfs(int u,int s,int c,int x)
{
if(u==n+1&&c==0)
{
res=max(res,s);
//cout<<res<<endl;
return;
}
if(u>=n+1||c<0)return;
else
{
//cout<<s<<" "<<c<<endl;
dfs(u+1,s,c,x*10+a[u]);
dfs(u+1,s*x,c-1,a[u]);
}
return;
}
signed main()
{
cin>>n>>k;
string s;
cin>>s;
for(int i=0;i<s.size();i++)
a[i]=s[i]-'0';
res=0;
dfs(1,1,k+1,a[0]);
cout<<res<<endl;
}