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.io.*;
import java.util.*;
import java.math.*;
import java.util.concurrent.SynchronousQueue;

public class graph_basics{
	public static final long mod =  1000000007;
	public static ArrayList<Integer>[] graph;
	public static InputReader in;
	public static PrintWriter w;
	static Edge edge[]; // collection of all edges
	static int level[],parent[],rank[],cost[];
	public static boolean vis[];
	public static HashMap<pair,Boolean> evis=new HashMap<pair,Boolean>();
	public static HashMap<pair,Integer> edges=new HashMap<pair,Integer>();
	public static HashSet<Integer> ans=new HashSet<Integer>();
	static int V=0,E=0,count=0;
	static String str;
	static char[][] arr;
	@SuppressWarnings("unchecked")
	public static void main(String[] args) {
		new Thread(null, new Runnable() {
			public void run() {
				try{
					solve();
					w.flush();
					w.close();
				}
				catch(Exception e){
					e.printStackTrace();
				}
			}
		}, "1", 1 << 26).start();
	}
	static ArrayList<Integer> topo;
	static int bit1[],bit2[];
	static int max_len,maxi;
	static void solve(){
		in = new InputReader(System.in);
		w = new PrintWriter(System.out);
//		int n=in.nextInt();
//		Stack<Integer> st=new Stack<Integer>();
//		TreeMap<Integer,Integer> map=new TreeMap();
//		int arr[]=in.nextIntArray(n);
//		for(int i=0;i<n;i++){
//			map.put(arr[i], i);
//		}
//		int ind[]=new int[n];
//		int s=1;
//		for(Map.Entry<Integer, Integer> entry:map.entrySet()){
//			int key=entry.getKey();
//			int val=entry.getValue();
//			ind[val]=s++;
//		}
//		int cnt=0;
//	
//		for(int i=n-1;i>=0;i--){
//			if(ind[i]==i+1){
//				w.println(1+" "+ind[i]);
//				cnt++;
//			}else{
//				if(st.isEmpty() || arr[st.peek()]<arr[i])
//					st.push(i);
//				else{
//					w.print(st.size()+" ");
//					while(!st.isEmpty()){
//						w.print(st.pop()+1+" ");
//					}
//					cnt++;
//					st.push(i);
//					w.println();
//				}
//			}
//		}
//		if(!st.isEmpty()){
//			w.print(st.size()+" ");
//			while(!st.isEmpty()){
//				w.print(st.pop()+1+" ");
//			}
//			cnt++;
//			w.println();
//		}
//		System.out.println(cnt);
		String str=in.readString();
		int k=in.nextInt();
		if(str.length()<k)
			w.println("impossible");
		else{
		HashSet<Character> hs=new HashSet();
		for(int i=0;i<str.length();i++){
			hs.add(str.charAt(i));
		}
		if(k-hs.size()>=0)
			w.println(k-hs.size());
		else
			w.println(0);
		}
	}
	static long pow(long x,  long y, long p)
	{
	    long res = 1;      // Initialize result
	 
	    x = x % p;  // Update x if it is more than or 
	                // equal to p
	 
	    while (y > 0)
	    {
	        // If y is odd, multiply x with result
	        if (y%2!=0)
	            res = (res*x) % p;
	 
	        // y must be even now
	        y = y>>1; // y = y/2
	        x = (x*x) % p;  
	    }
	    return res;
	}
	
	static class Pa implements Comparable<Pa>{
		int ind,data;
		public Pa(int ind,int data){
			this.ind=ind;
			this.data=data;
		}
		public int compareTo(Pa that){
			return Integer.compare(this.data, that.data);
		}
	}
	public static void dfs(int cur,int par,int prev){
		vis[cur]=true;
		int cur_len=0;
		for(Integer next:graph[cur]){
			if(cur!=par){
				if(!vis[next]){
					cur_len=prev+1;
					dfs(next,cur,cur_len);
				}	
			}
			if(max_len<cur_len){
				max_len=cur_len;
				maxi=next+1;
			}
			if(max_len==cur_len && maxi<next+1){
				maxi=next+1;
			}
			cur_len=0;
		}
	vis[cur]=false;	
	}
	public static int findSet(int[] P, int[] rank, int x) {
		if (P[x] == x)
			return x;
		return P[x] = findSet(P, rank, P[x]);
	}

	public static void mergeSet(int[] P, int[] rank, int x, int y) {
		int px = findSet(P, rank, x),
				py = findSet(P, rank, y);
		if (rank[px] > rank[py])
			P[py] = px;
		else
			P[px] = py;
		if (rank[px] == rank[py])
			rank[py]++;
	}
	static class pair  implements Comparable<pair>{
		int x,y;
		public pair(Integer x,Integer y){
			this.x=x;
			this.y=y;
		}
		public int compareTo(pair that){
			return Integer.compare(this.y, that.y);
		}
	}
	static class Node {
		int u, v, type;

		public Node(int u, int v, int type) {
			this.u = u;
			this.v = v;
			this.type = type;
		}
	}

	static class Edge implements Comparable<Edge>
	{
		int src, dest, weight;

		// Comparator function used for sorting edges based on
		// their weight
		public int compareTo(Edge compareEdge)
		{
			return this.weight-compareEdge.weight;
		}
	};
	static class BIT
	{
	    int[] tree;
	    int n;
	    BIT(int n)
	    {
	        tree = new int[n+1];
	        this.n = n;
	    }
	    /*
	     * Increases the value at x by v.
	     */
	    void upd(int x, int v)
	    {
	        int i = x;
	        while(i<=n)
	        {
	            tree[i]+=v;
	            i += (i&-i);
	        }
	    }
	    /*
	     * Returns the sum of the first x elements.
	     */
	    int csum(int x)
	    {
	        int s = 0;
	        while(x>0)
	        {
	            s += tree[x];
	            x -= (x&-x);
	        }
	        return s;
	    }
	    /*
	     * Returns the sum of elements x through y, inclusive.
	     */
	    int csum(int x, int y)
	    {
	        return csum(y) - csum(x-1);
	    }
	    /*
	     * Returns the xth value in the tree.
	     */
	    int get(int x)
	    {
	        int sum = tree[x];
	        int z = x - (x&-x);
	        x--;
	        while(x>z)
	        {
	            sum -= tree[x];
	            x -= (x&-x);
	        }
	        return sum;
	    }
	    /*
	     * Multiplies every element in the tree by a.
	     */
	    void scale(int a)
	    {
	        for(int i = 1; i<=n; i++) tree[i] *= a;
	    }
	}
	static class InputReader {

		private InputStream stream;
		private byte[] buf = new byte[8192];
		private int curChar, snumChars;
		private SpaceCharFilter filter;

		public InputReader(InputStream stream) {
			this.stream = stream;
		}

		public int snext() {
			if (snumChars == -1)
				throw new InputMismatchException();
			if (curChar >= snumChars) {
				curChar = 0;
				try {
					snumChars = stream.read(buf);
				} catch (IOException e) {
					throw new InputMismatchException();
				}
				if (snumChars <= 0)
					return -1;
			}
			return buf[curChar++];
		}

		public int nextInt() {
			int c = snext();
			while (isSpaceChar(c))
				c = snext();
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = snext();
			}
			int res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = snext();
			} while (!isSpaceChar(c));
			return res * sgn;
		}

		public long nextLong() {
			int c = snext();
			while (isSpaceChar(c))
				c = snext();
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = snext();
			}
			long res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = snext();
			} while (!isSpaceChar(c));
			return res * sgn;
		}

		public int[] nextIntArray(int n) {
			int a[] = new int[n];
			for (int i = 0; i < n; i++)
				a[i] = nextInt();
			return a;
		}

		public String readString() {
			int c = snext();
			while (isSpaceChar(c))
				c = snext();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = snext();
			} while (!isSpaceChar(c));
			return res.toString();
		}

		public boolean isSpaceChar(int c) {
			if (filter != null)
				return filter.isSpaceChar(c);
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}

		public interface SpaceCharFilter {
			public boolean isSpaceChar(int ch);
		}
	}
} 