A. Diversity

time limit per test

memory limit per test

input

output

s, so that it contains at least k

s

Input

s, consisting only of lowercase Latin letters (1 ≤ |s| ≤ 1000, |s| denotes the length of s).

k (1 ≤ k ≤ 26).

Output

impossible» (without quotes) if it is impossible.

Examples

input

yandex 6

output

0

input

yahoo 5

output

1

input

google 7

output

impossible

Note

6

4 different letters: {'a', 'h', 'o', 'y'}. To get 5 different letters it is necessary to change one occurrence of 'o' to some letter, which doesn't occur in the string, for example, {'b'}.

7 different letters because the length of the string is 6.

水题

#include<cstdio>
#include<iostream>
#include<algorithm>
#include<cstring>
#include<string>
#include<set>
using namespace std;
int main()
{
set<int>ff;
char s[1010];
int k;
scanf("%s",s);
scanf("%d",&k);
int len=strlen(s);
for(int i=0;i<len;i++)
{
ff.insert(s[i]);
}
if(len<k)
printf("impossible\n");
else
{
int w=ff.size();
if(w>=k)
printf("0\n");
else
printf("%d\n",k-w);
}
return 0;
}