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 sun.reflect.generics.tree.Tree;

import java.io.*;
import java.lang.reflect.Array;
import java.math.BigInteger;
import java.util.*;

public class Main {


    long MODULO = 998244353;
    int INF = Integer.MAX_VALUE - 1234567;

    class Pair implements Comparable<Pair> {
        int value, pos;

        public Pair(int value, int pos) {
            this.value = value;
            this.pos = pos;
        }

        @Override
        public int compareTo(Pair o) {
            if (this.value == o.value) return Integer.compare(this.pos, o.pos);
            return Integer.compare(this.value, o.value);
        }

        @Override
        public boolean equals(Object o) {
            if (this == o) return true;
            if (o == null || getClass() != o.getClass()) return false;
            Pair pair = (Pair) o;
            return value == pair.value &&
                    pos == pair.pos;
        }

        @Override
        public int hashCode() {
            return Objects.hash(value, pos);
        }
    }

    class Triplet implements Comparable<Triplet> {
        int x, y, z, i;

        public Triplet(int x, int y, int z, int i) {
            this.x = x;
            this.y = y;
            this.z = z;
            this.i = i;
        }

        @Override
        public int compareTo(Triplet o) {
            if (this.x == o.x) {
                if (this.y == o.y) {
                    return Integer.compare(this.z, o.z);
                }
                return Integer.compare(this.y, o.y);
            }
            return Integer.compare(this.x, o.x);
        }
    }

    void solve() throws IOException {
        int K = 20;
        int MAX_MASK = 1 << 20;
        char[] s = readString().toCharArray();
        int n = s.length;

        boolean[] maskInString = new boolean[MAX_MASK];

        for (int i = 0; i < n; ++i) {
            int curMask = 0;
            for (int j = i; j < Math.min(i + K, n); ++j) {
                int curBit = s[j] - 'a';
                if (checkBit(curMask, curBit)) break;
                curMask |= 1 << curBit;
                maskInString[curMask] = true;
            }
        }

        int[] dp = new int[MAX_MASK];

        for (int mask = 0; mask < MAX_MASK; ++mask) {
            if (maskInString[mask]) dp[mask] = Integer.bitCount(mask);
            for (int bit = 0; bit < K; ++bit) {
                if (checkBit(mask, bit)) dp[mask] = Math.max(dp[mask], dp[mask ^ (1 << bit)]);
            }
        }

        int ans = 0;
        for (int mask = 0; mask < MAX_MASK; ++mask) {
            if (maskInString[mask]) ans = Math.max(ans, Integer.bitCount(mask) + dp[(MAX_MASK - 1) ^ mask]);
        }
        out.println(ans);
    }

    long gcd(long a, long b) {
        return a % b == 0 ? b : gcd(b, a % b);
    }

    int[][] steps = {{1, 0}, {0, 1}};
    String fileName = "";
    private final static Random rnd = new Random();

    boolean checkBit(long mask, int bit) {
        return (mask & (1l << bit)) > 0;
    }

    ////////////////////////////////////////////////////////////
    public static void main(String[] args) throws NumberFormatException, IOException {
        // TODO Auto-generated method stub
        new Main().run();
    }

    void run() throws NumberFormatException, IOException {
        solve();
        out.close();
    }

    ;

    BufferedReader in;
    PrintWriter out;

    StringTokenizer tok;
    String delim = " ";

    Main() throws FileNotFoundException {
        try {
            in = new BufferedReader(new FileReader("input.txt"));
            out = new PrintWriter("output.txt");
        } catch (Exception e) {
            if (fileName.isEmpty()) {
                in = new BufferedReader(new InputStreamReader(System.in));
                out = new PrintWriter(System.out);
            } else {
                in = new BufferedReader(new FileReader(fileName + ".in"));
                out = new PrintWriter(fileName + ".out");
            }

        }
        tok = new StringTokenizer("");
    }

    String readLine() throws IOException {
        return in.readLine();
    }

    String readString() throws IOException {
        while (!tok.hasMoreTokens()) {
            String nextLine = readLine();
            if (null == nextLine) {
                return null;
            }

            tok = new StringTokenizer(nextLine);
        }
        return tok.nextToken(delim);
    }

    int readInt() throws NumberFormatException, IOException {
        return Integer.parseInt(readString());
    }

    long readLong() throws NumberFormatException, IOException {
        return Long.parseLong(readString());
    }

    int[] readIntArray(int n) throws NumberFormatException, IOException {
        int[] a = new int[n];
        for (int i = 0; i < n; ++i) {
            a[i] = readInt();
        }
        return a;
    }

    double readDouble() throws NumberFormatException, IOException {
        return Double.parseDouble(readString());
    }
}