Calculate the minimum number of characters you need to change in the string s, so that it contains at least k different letters, or print that it is impossible.

String s consists only of lowercase Latin letters, and it is allowed to change characters only to lowercase Latin letters too.

Input

First line of input contains string s, consisting only of lowercase Latin letters (1 ≤ |s| ≤ 1000, |s| denotes the length of s).

Second line of input contains integer k (1 ≤ k ≤ 26).

Output

Print single line with a minimum number of necessary changes, or the word «impossible» (without quotes) if it is impossible.

Examples

Input

yandex
6


Output

0


Input

yahoo
5


Output

1


Input

google
7


Output

impossible

Note

In the first test case string contains 6 different letters, so we don't need to change anything.

In the second test case string contains 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'}.

In the third test case, it is impossible to make 7 different letters because the length of the string is 6.
import java.util.*;
import java.io.*;
 
 
   
 
 
 
    public class Sample implements Runnable{
   // static ArrayList<Integer>[] al;
         static class Pair implements Comparable<Pair>{
  long a;
  long b;
   
  Pair(){
 
  }
  Pair(long a,long b){
      this.a=a;
      this.b=b;
  }
   
  public int compareTo(Pair x)
        {







        return Long.compare(x.a,this.a);
    }
}
  static class Beauty implements Comparator<Beauty>{
    int beauty;
    int cost;
    Beauty(){
        }
    Beauty(int beauty,int cost){
      this.beauty=beauty;
      this.cost=cost;
 
    }
    public int compare(Beauty b1,Beauty b2 ){
      if(b2.beauty-b1.beauty==0){
        return b1.cost-b2.cost;
      }else{
        return b2.beauty-b1.beauty;
      }
    }
 
  }
   
  
   static InputReader sc = new InputReader(); 
   static int gcd(int a,int b){
    if(a==0){
      return b;
    }
    return gcd(b%a,a);
   }
   static int d;
   static int[] color;
   static boolean[] v;
  /*  static void dfs(int src,int x,int y){
      v[src]=true;
     int  i=1;
     color[src]=x;
      for(int a :al[src]){
        if(v[a]) continue;
        if(i==x|| i==y){
          i++;
          if(i==x|| i==y){
          i++;
        }
        }
        color[a]=i;
        i++;
         
      }
      for(int a:al[src]){
        if(!v[a]){
          dfs(a,color[a],x);
        }
      }
 
 
 
    }*/
    static long[] a;
    static long[] b;
    public static boolean possible(double mid,int n){
      double l=a[1]-b[1]*mid;
      double r=a[1]+b[1]*mid;
      for(int i=2;i<=n;i++){
        l=Math.max(l,a[i]-b[i]*mid);
        r=Math.min(r,a[i]+b[i]*mid);
 
      }
      if(l>r)return false;
      else  return true;
    }
 
public static boolean isvowel(char ch){
    if(ch=='a'||ch=='e'||ch=='i'||ch=='o'||ch=='u'){
        return true;
    }else{
        return false;
    }
}
static long[] fac;
 static long[] inv;
 static long mod=(long)1e9+7;
static int[] prime;
static Integer[] ans;
 
static ArrayList<Integer>[] al1;
static ArrayList<Integer>[] al2;
static int[] lol1;
static int[] lol2;
static boolean[] v1;
static boolean[] v2;
 
 
    
     public static void main(String[] args) throws IOException
    { 
         new Thread(null, new Sample(), "whatever", 1<<26).start();
         

      
    }
   

   

     boolean findSum(int set[], int n, long sum)
    {
       // Base Cases
       if (sum == 0)
         return true;
       if (n == 0 && sum != 0)
         return false;
      
       // If last element is greater than sum, then ignore it
       if (set[n-1] > sum)
         return findSum(set, n-1, sum);
      
       /* else, check if sum can be obtained by any of the following
          (a) including the last element
          (b) excluding the last element   */
       return findSum(set, n-1, sum) || 
                                   findSum(set, n-1, sum-set[n-1]);
    }
 
 
  public class IntegerComparator implements Comparator<Integer> {

    @Override
    public int compare(Integer o1, Integer o2) {
        return o2.compareTo(o1);
    }
}
    static int[] pro_a;
    static ArrayList pro_b[];
    static ArrayList<Integer> seg[];
    public static void build(int low,int high,int pos){
      if(low>high){ return ;}
      if(low==high){
        seg[pos]=pro_b[low];
        return;
        
      }
      int mid=(low+high)>>1;
      build(low,mid,2*pos+1);
      build(mid+1,high,2*pos+2);
      seg[pos]=merge(seg[2*pos+1],seg[2*pos+2]);
      
    }
    public static ArrayList merge(ArrayList<Integer> a1,ArrayList<Integer> a2){
      ArrayList<Integer> result=new ArrayList<Integer>();
      int i=0;
      int j=0;
      while(i<a1.size() && j<a2.size()){
        if((a1.get(i))<(a2.get(j))){
         
          result.add(a1.get(i));
           i++;
        }
        else if(a1.get(i)>a2.get(j)){
          
          result.add(a2.get(j));
          j++;
        }
        else{
         
          result.add(a1.get(i));
          result.add(a2.get(j));
           i++;j++;
        }

      }
      while(i<a1.size()){
        result.add(a1.get(i));
        i++;
      }
      while(j<a2.size()){
        result.add(a2.get(j));
          j++;
      }
       
      
      return result;
    }
    public int find(int low,int high,int pos,int l,int r,int x,int y){
          if(l<=low && high<=r){
            int find_x=lower_bound(seg[pos],x);
            int find_y=upper_bound(seg[pos],y);
          // System.out.println(find_x+" "+find_y);
            return (find_y-find_x);
          }
          if(l>high || r<low){
            return 0;
          }
          int mid=(low+high)>>1;
          return find(low,mid,2*pos+1,l,r,x,y)+find(mid+1,high,2*pos+2,l,r,x,y);
    }
    int lower_bound(ArrayList<Integer> a, int key) {
        int l = 0;
        int h = a.size(); // Not n - 1
 
        
        
        while (l < h) {
            int mid = (l + h) / 2;
            if (key <= a.get(mid)) {
                h = mid;
            } else {
                l = mid + 1;
            }
        }
        return l;
    }
      int upper_bound(ArrayList<Integer> a, int key) {
        int l = 0;
          int h = a.size(); // Not n - 1
 
          if(key>=a.get(h-1))
          return (h);
        
        while (l < h) {
            int mid = (l + h) / 2;
            if (key >= a.get(mid)) {
                l = mid + 1;
            } else {
                h = mid;
            }
        }
  
        return l;
    }
    static ArrayList[] dfs_array;
    static boolean[] visited;
    static int count=0;
    static double ans22=0;
    public void run(){
                     String s=s();
                     int N=i();
                     int[] lol=new int[26];
                     for(int i=0;i<s.length();i++){
                      lol[s.charAt(i)-'a']++;
                     }
                     int count=0;
                     for (int i=0;i<26 ;i++ ) {
                       if(lol[i]>0){count++;}
                     }
                     if(s.length()<N){
                      System.out.println("impossible");

                     }
                     else{
                      if(count>N){
                        System.out.println("0");
                      }
                      else{
                        System.out.println(N-count);
                      }
                     }
       }
       
       
       
     public static int lower_bound_array(int[] arr, long key) {
    int len = arr.length;
    int lo = 0;
    int hi = len-1;
    int mid = (lo + hi)/2;
    while (true) {
      int cmp = Long.compare(arr[mid],(key));
       
        if (cmp < 0) {
        lo = mid+1;
        if (hi < lo)
          return mid<len-1?mid+1:-1;
      } else {
        hi = mid-1;
        if (hi < lo)
          return mid;
      }
      mid = (lo + hi)/2;
    }
  }
         
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
    
    /////////////////////////////////////////////////////////// shortcuts //////////////////////////////
      public static long modPow(long base, long exp, long mod) {
        base = base % mod;
        long result = 1;
        while (exp > 0) {
            if (exp % 2 == 1) {
                result = (result * base) % mod;
                exp--;
            } else {
                base = (base * base) % mod;
                exp = exp >> 1;
            }
 
        }
        return result;
    }
 
 
    public static void cal() {
        fac = new long[1000005];
        inv = new long[1000005];
        fac[0] = 1;
        inv[0] = 1;
        for (int i = 1; i <= 1000000; i++) {
            fac[i] = (fac[i - 1] * i) % mod;
            inv[i] = (inv[i - 1] * modPow(i, mod - 2, mod)) % mod;
        }
    }
 
   /* public static long ncr(int n, int r) {
        return (((fac[n] * inv[r]) % mod) * inv[n - r]) % mod;
    }
 */
 
      static int i() {
           
          return sc.nextInt();
        }
        static long l(){
          return sc.nextLong();
 
        }
        static double d() {
          return sc.nextDouble();
        }
        static String s(){
          return sc.next();
 
        }
        static String sL() throws IOException{
          return sc.nextLine();
        }
       static void loop(int[] a) throws IOException{
          for(int j=0;j<a.length;j++){
              a[j]=i();
          }
        }
        static void eloop(int[] a) throws IOException{
          for(int i=1;i<=a.length;i++){
              a[i]=i();
          }
        }
        static void ploop(int[] a)throws IOException{
             for(int j=0;j<a.length;j++){
                System.out.println(a[j]);
             }
 
        }
        static void eploop(int[] a)throws IOException{
             for(int j=1;j<=a.length;j++){
                System.out.println(a[j]);
             }
 
        } 
  
        ////////////////////////////////////////////////////////////////////////////////////////////////////
     
 
   
 
  static class InputReader {
        BufferedReader br;
        StringTokenizer st;
 
        public InputReader() {
            br = new BufferedReader(new
                    InputStreamReader(System.in));
        }
 
        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException  e) {
                    throw new RuntimeException();
                }
            }
            return st.nextToken();
        }
 
        int nextInt() {
            return Integer.parseInt(next());
        }
 
        long nextLong() {
            return Long.parseLong(next());
        }
 
        double nextDouble() {
            return Double.parseDouble(next());
        }
 
        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            }
            catch (IOException e) {
                throw new RuntimeException();
            }
            return str;
        }
    }
 
 }  




