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.


/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */





import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import static java.lang.System.in;
import java.lang.reflect.Array;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.AbstractList;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import static java.util.Collections.list;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Scanner;
import java.util.Set;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import java.util.stream.DoubleStream;
import java.util.stream.IntStream;
import java.util.stream.Stream;
import javax.xml.stream.events.Characters;
import sun.security.util.Length;





/**
 *
 * @author george
 */
public class main {
public static boolean isPrime(long n) {
    if(n < 2) return false;
    if(n == 2 || n == 3) return true;
    if(n%2 == 0 || n%3 == 0) return false;
    long sqrtN = (long)Math.sqrt(n)+1;
    for(long i = 6L; i <= sqrtN; i += 6) {
        if(n%(i-1) == 0 || n%(i+1) == 0) return false;
    }
    return true;
}

    private static long f(long l) {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

static public class Princess{
 public int rate;public int beauty;public int intellect;public int richness;
 public Princess(int sum,int a,int b,int c){
  this.rate=sum;
  this.beauty=a;
  this.intellect=b;
  this.richness=c;
  }

        @Override
        public String toString() {
            return "Princess{" + "rate=" + rate + ", beauty=" + beauty + ", intellect=" + intellect + ", richness=" + richness + '}';
        }
 
 }
public static boolean contains(final int[] arr, final int key) {
    return Arrays.stream(arr).anyMatch(i -> i == key);
}
 static boolean isSubSequence(String str1, String str2, int m, int n)
    {
       
        if (m == 0) 
            return true;
        if (n == 0) 
            return false;
             
        
        if (str1.charAt(m-1) == str2.charAt(n-1))
            return isSubSequence(str1, str2, m-1, n-1);
 
        
        return isSubSequence(str1, str2, m, n-1);
    }

    static int gcdThing(int a, int b) {
    BigInteger b1 = BigInteger.valueOf(a);
    BigInteger b2 = BigInteger.valueOf(b);
    BigInteger gcd = b1.gcd(b2);
    return gcd.intValue();
}
    public static boolean checkAnagram(String str1, String str2) {
        int i=0;
        for (char c : str1.toCharArray()) {
        i = str2.indexOf(c, i) + 1;
        if (i <= 0) { return false; }
    }
    return true;

}
    /* Amusing Joke 
    String a,b,c;
     a=s.next();b=s.next();c=s.next();
     if((a.length()+b.length())!=c.length()){System.out.print("here");System.out.print("NO");}
     else{
         boolean x= true;
         String agex="";
         if(checkAnagram(a, c)==false){System.out.print("here1");x=false;}
         else{
             char [] g=a.toCharArray();
             Arrays.sort(g);String ge=new String(g);a=ge;
             g=b.toCharArray();Arrays.sort(g);ge=new String(b);b=ge;
             g=c.toCharArray();Arrays.sort(g);ge=new String(c);c=ge;
            if(isSubSequence(a, c, a.length(), c.length())){
                 StringBuilder sb = new StringBuilder(c);String temp="";
                for (int i = 0; i < a.length(); i++) {
                    temp+=a.charAt(i);
                 c.replaceFirst(temp, "");temp="";
                   
                }
            }
            else{x=false;}
            if(isSubSequence(a, c, a.length(), c.length())){
              StringBuilder sb = new StringBuilder(c);
                for (int i = 0; i < b.length(); i++) {
                  String temp="";
                    temp+=b.charAt(i);
                 c.replaceFirst(temp, "");temp="";
                   
                }
            }
            else{x=false;}
            if(c.length()!=0){x=false;}
    }if(x==false){System.out.print("NO");}
    else{System.out.print("YES");}
    }
    */
     /*//t,l,r
      long t,l,r;t=s.nextLong();l=s.nextLong();r=s.nextLong();
      long exp=0;
      // t0·f(l) + t1·f(l + 1) + ... + tr - l·f(r).
        for (int i = 0; i <=r-l; i++) {
            exp+=((long)(Math.pow(t, i)))*f(l+i);
        }
        System.out.print(exp%(1000000007));*/
    /* 489C
        int digits=s.nextInt();int sum=s.nextInt();
        List <Integer>li=new ArrayList<Integer>();
       int digitss=sum/9;
       int rem=digits%9;
       String z=String.join("", Collections.nCopies(digitss, "9"));
       String z+=
       String digit="9";
       String x = String.join("", Collections.nCopies(digits, "9"));
       BigInteger num=BigInteger.valueOf(Long.parseLong(x));
       x=num.toString();System.out.print(x);
       li.clear();
        for (int i = 0; i < x.length(); i++) {
            li.add(x.charAt(i)-48);
        }
       Collections.sort(li);
       int zeros=0;
       //leading zeros
       String f="";
        for (int i = 0; i < li.size(); i++) {
            if(li.get(0)==0){zeros++;li.remove(0);}
            else{f=li.get(0).toString(); break;}
        }
        
        String y="";
        if(zeros!=0){
            li.remove(0);
            y+=String.join("", Collections.nCopies(zeros, "0"));
            
        }
       y+=li.stream().map(Object::toString).collect(Collectors.joining());
       System.out.print(y);System.out.print(" ");System.out.print(x);
    */
    
    public static List primeFactors(Long num)
    {
        List<Long>Prime=new ArrayList<Long>();
        // Print the number of 2s that divide n
        long tw=2;
        while (num%2==0)
        {
            Prime.add(tw);
            num /= 2;
        }
 
        // n must be odd at this point.  So we can
        // skip one element (Note i = i +2)
        for (long i = 3; i <= Math.sqrt(num); i+= 2)
        {
            // While i divides n, print i and divide n
            while (num%i == 0)
            {
                Prime.add(i);
                num/= i;
            }
        }
 
        // This condition is to handle the case whien
        // n is a prime number greater than 2
        if (num> 2)
            Prime.add(num);        
        return Prime;
    }
    public static String Winner(int [] arr)
    {
        int maxsum=-1;
        int temp=0;
        List<Integer> L=Arrays.stream(arr).boxed().collect(Collectors.toList());
        int count=0;
        String winner="First";
        while(L.isEmpty()!=true){
           if(count%2==0){winner="First";
           //take max odd interval
            for (int i = 0; i < L.size(); i++) {
                
            }
            }
           else{winner="Second";
           
           
           
           
           
           
           
           }
           count++;
        }
    
    
    return winner;
    }
    public static String changeCharInPosition(int position, char ch, String str){
    char[] charArray = str.toCharArray();
    charArray[position] = ch;
    return new String(charArray);
    }
    /*
    (Two televisions 845C)
    int n=s.nextInt();
        String x=s.next();
        int k=s.nextInt();
        int [] ind=new int[k];
        char [] cho=new char[k];
        String help;
        for (int i = 0; i < k; i++) {
            help="";
            ind[i]=s.nextInt();
            help=s.next();
            cho[i]=help.charAt(0);
        }
        String substring="";
        int maxcount=1;
        int tempcount=0;
        int occChar=0;
        help="";
        for (int i = 0; i < k; i++) {
        substring="";    
        help="";
         help+=cho[i];
         occChar=x.length() - x.replace(help, "").length();
         if((occChar+ind[i])>=n){System.out.println(n);continue;}
         for (int j = 0; j < n; j++) {
             if(x.charAt(j)!=cho[i]){continue;}
                for (int l = j+1; l < n; l++) {
                 if(x.charAt(l)==cho[i]){substring=x.substring(j, l+1);System.out.println(substring);
                 help="";help+=cho[i];
                 occChar=substring.length() - substring.replace(help, "").length();
                 tempcount=substring.length()-occChar;
                 if(substring.length()>maxcount&&tempcount<=ind[i]){maxcount=tempcount;tempcount=0;}
                 }
             }
            }
        // System.out.println(maxcount);maxcount=0;
        }*/
    /* int n=s.nextInt();
        int [] l=new int[n];
        int [] r=new int[n];
            for (int i = 0; i< n; i++) {
            l[i]=s.nextInt();
            r[i]=s.nextInt();
          }
            boolean cond=false;
            List<Integer>TV1L=new ArrayList<Integer>();
            List<Integer>TV1R=new ArrayList<Integer>();
            List<Integer>TV2L=new ArrayList<Integer>();
            List<Integer>TV2R=new ArrayList<Integer>();
              for (int i = 1; i < n; i++) {
              if(TV1L.contains(l[i])==false&&TV1R.contains(r[i])==false){TV1L.add(l[i]);TV1R.add(r[i]);}
              else{
              if(TV2L.contains(l[i])==false&&TV2R.contains(r[i])==false){TV2L.add(l[i]);TV2R.add(r[i]);}
              else{System.out.print("NO");System.exit(0);}
              }
              }
              Collections.sort(TV1R);Collections.sort(TV1L);
         //we will check everyTV interval if it is intersected or not
         int countTv1=0;
              for (int i = 0; i < TV1L.size()-1; i++) {
            if(TV1R.get(i)-TV1L.get(i+1)>0){countTv1++;}
            else if(TV1R.get(i)-TV1L.get(i+1)==0){System.out.print("NO");System.exit(0);}
        }
              for (int i = 0; i < TV1L.size()-1; i++) {
            if(TV1L.get(i+1)-TV1R.get(i)>0){countTv1++;}
              else if(TV1L.get(i+1)-TV1R.get(i)==0){System.out.print("NO");System.exit(0);}
        }
              if(countTv1<TV1L.size()){System.out.print("NO");System.exit(0);}
              Collections.sort(TV2R);Collections.sort(TV2L);
         //we will check everyTV interval if it is intersected or not
         int countTv2=0;
              for (int i = 0; i < TV2L.size()-1; i++) {
            if(TV2R.get(i)-TV2L.get(i+1)>0){countTv2++;}
            else if(TV2R.get(i)-TV2L.get(i+1)==0){System.out.print("NO");System.exit(0);}
        }
              for (int i = 0; i < TV2L.size()-1; i++) {
            if(TV2L.get(i+1)-TV2R.get(i)>0){countTv2++;}
              else if(TV2L.get(i+1)-TV2R.get(i)==0){System.out.print("NO");System.exit(0);}
        }
              if(countTv2<TV2L.size()){System.out.print("NO");System.exit(0);}
              System.out.print("YES");
        */
   public static boolean CheckCanObtainYfromX(String y,String x){
        boolean cond=true;
        String help="";
        for (int i = 0; i < y.length(); i++) {
            help="";help+=y.charAt(i);
            if(y.contains(help)==false){x=x.replaceFirst(help,"A");cond=false;break;}
            
        }
        return cond;
    }
   public static int LongestPalindrome(String x){
    int n=x.length();
    boolean table[][] = new boolean[n][n];
    int maxLength = 1;
     for (int i = 0; i < n; ++i)
            table[i][i] = true;
   int start = 0;
    for (int i = 0; i < n - 1; ++i) {
            if (x.charAt(i) == x.charAt(i + 1)) {
                table[i][i + 1] = true;
                start = i;
                maxLength = 2;
            }
        }
     for (int k = 3; k <= n; ++k) {
            for (int i = 0; i < n - k + 1; ++i) 
            {
                int j = i + k - 1;
               if (table[i + 1][j - 1] && x.charAt(i) == x.charAt(j)) {
                    table[i][j] = true;
                if (k > maxLength) {
                        start = i;
                        maxLength = k;
                    }
                }
            }
     }
   return maxLength;
   }
    public static void main (String []  args) throws IOException 
    {
        Scanner s=new Scanner(System.in);
       String x=s.next();
       int k=s.nextInt();
       Set<Character> charsSet = x.chars().mapToObj(e->(char)e).collect(Collectors.toSet());
       if(x.length()<k ){System.out.print("impossible");}
       else if(charsSet.size()>=k){System.out.print(0);}
       else{System.out.print(k-charsSet.size());}
        
    }
}