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.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Shurikat
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskA solver = new TaskA();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskA {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            char[] s = in.nextLine(100).toCharArray();
            int k = in.nextInt();
            int[] cnt = new int['z' - 'a' + 1];
            for (int i = 0; i < s.length; ++i) {
                cnt[s[i] - 'a']++;
            }
            int free = 0;
            int com = 0;
            int already = 0;
            for (int i = 0; i < cnt.length; ++i) {
                if (cnt[i] == 0) {
                    free++;
                } else {
                    already++;
                    com += cnt[i] - 1;
                }
            }
            if (com + already >= k && free + already >= k) {
                out.print(Math.max(0, k - already));
            } else {
                out.print("impossible");
            }
        }

    }

    static class InputReader implements AutoCloseable {
        private final InputStream in;
        private int capacity;
        private byte[] buffer;
        private int len = 0;
        private int cur = 0;

        public InputReader(InputStream stream) {
            this(stream, 100_000);
        }

        public InputReader(InputStream stream, int capacity) {
            this.in = stream;
            this.capacity = capacity;
            buffer = new byte[capacity];
        }

        private boolean update() {
            if (cur >= len) {
                try {
                    cur = 0;
                    len = in.read(buffer, 0, capacity);
                    if (len <= 0)
                        return false;
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
            }
            return true;
        }

        private int read() {
            if (update())
                return buffer[cur++];
            else return -1;
        }

        private boolean isSpace(int c) {
            return c == '\n' || c == '\t' || c == '\r' || c == ' ';
        }

        private boolean isEscape(int c) {
            return c == '\n' || c == '\t' || c == '\r' || c == -1;
        }

        private int readSkipSpace() {
            int c;
            do {
                c = read();
            } while (isSpace(c));
            return c;
        }

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

        public String nextLine(int initialCapacity) {
            StringBuilder res = new StringBuilder(initialCapacity);
            int c = readSkipSpace();
            do {
                res.append((char) (c));
                c = read();
            } while (!isEscape(c));
            return res.toString();
        }


        public void close() throws IOException {
            in.close();
        }

    }
}

