Problem: You are given a string s consisting only of first 20 lowercase Latin letters ('a', 'b', ..., 't').

Recall that the substring s[l; r] of the string s is the string s_l s_{l + 1} ... s_r. For example, the substrings of "codeforces" are "code", "force", "f", "for", but not "coder" and "top".

You can perform the following operation no more than once: choose some substring s[l; r] and reverse it (i.e. the string s_l s_{l + 1} ... s_r becomes s_r s_{r - 1} ... s_l).

Your goal is to maximize the length of the maximum substring of s consisting of distinct (i.e. unique) characters.

The string consists of distinct characters if no character in this string appears more than once. For example, strings "abcde", "arctg" and "minecraft" consist of distinct characters but strings "codeforces", "abacaba" do not consist of distinct characters.

Input

The only line of the input contains one string s consisting of no more than 10^6 characters 'a', 'b', ..., 't' (first 20 lowercase Latin letters).

Output

Print one integer — the maximum possible length of the maximum substring of s consisting of distinct characters after reversing no more than one its substring.

Examples

Input


abacaba


Output


3


Input


abcdecdf


Output


6


Input


aabbcc


Output


3


Input


abcdeefc


Output


6

Solution (in JAVA):

Solution:
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 beginner1010
 */
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);
        TaskF solver = new TaskF();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskF {
        final int Alpha = 20;

        int two(int bit) {
            return 1 << bit;
        }

        boolean contain(int mask, int bit) {
            return (mask & two(bit)) > 0;
        }

        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int[] bitCount = new int[two(Alpha)];
            for (int i = 1; i < two(Alpha); i++) {
                bitCount[i] = bitCount[i & (i - 1)] + 1;
            }
            int[] dp = new int[two(Alpha)];
            char[] s = in.nextLine().toCharArray();
            int n = s.length;
            for (int i = 0; i < n; i++) {
                int curMask = 0;
                for (int j = i; j < n; j++) {
                    int c = s[j] - 'a';
                    if (contain(curMask, c)) break;
                    curMask |= two(c);
                    dp[curMask] = bitCount[curMask];
                }
            }

            for (int mask = 0; mask < two(Alpha); mask++) {
                for (int bit = 0; bit < Alpha; bit++) {
                    if (contain(mask, bit) == true) {
                        dp[mask] = Math.max(dp[mask], dp[mask ^ two(bit)]);
                    }
                }
            }

            int ans = 0;
            for (int mask = 0; mask < two(Alpha); mask++) {
                int comp = (two(Alpha) - 1) ^ mask;
                ans = Math.max(ans, dp[mask] + dp[comp]);
            }
            out.println(ans);
        }

    }

    static class InputReader {
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private InputStream stream;

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

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

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

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

        public String nextLine() {
            int c = read();
            while (isWhitespace(c))
                c = read();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isEndOfLine(c));
            return res.toString();
        }

    }
}