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.util.*;
import java.io.*;
import java.text.*;

public class F1234 {

	static HashSet<Integer> hs = new HashSet<Integer>();
	static int [] dp = new int [1<<20];
	public static int dp (int bitmask) {
		if(dp[bitmask]!=-1)
			return dp[bitmask];
		if(hs.contains(bitmask))
			return Integer.bitCount(bitmask);
		int ans = 0;
		for(int i=0;i<20;i++) {
			if((bitmask & (1<<i))!=0) {
				ans = Math.max(dp(bitmask ^ (1<<i)), ans);
			}
		}
		return dp[bitmask] = ans;
	}
	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		PrintWriter pw = new PrintWriter(System.out);
		char[] x = sc.next().toCharArray();
		for (int i = 0; i < x.length; i++) {
			x[i] -= 'a';
		}
		
		hs.add(0);
		for(int i=0;i<x.length;i++) {
			int bitmask =0;
			for(int j=0;j<20 && (i+j)<x.length;j++) {
				if((bitmask&(1<<x[i+j]))==0) {
					bitmask|=(1<<x[i+j]);
					hs.add(bitmask);
				}else {
					break;
				}
			}
		}
		Arrays.fill(dp, -1);
		int ans =0;
		for(int u : hs) {
			ans = Math.max(ans, Integer.bitCount(u)+dp(u^((1<<20)-1)));
		}
//		for(int u:hs) {
//			pw.println(Integer.toBinaryString(u));
//		}
		pw.println(ans);
		pw.close();
	}

	static class Scanner {
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream s) {
			br = new BufferedReader(new InputStreamReader(s));
		}

		public Scanner(FileReader r) {
			br = new BufferedReader(r);
		}

		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

		public int nextInt() throws IOException {
			return Integer.parseInt(next());
		}

		public long nextLong() throws IOException {
			return Long.parseLong(next());
		}

		public String nextLine() throws IOException {
			return br.readLine();
		}

		public double nextDouble() throws IOException {
			String x = next();
			StringBuilder sb = new StringBuilder("0");
			double res = 0, f = 1;
			boolean dec = false, neg = false;
			int start = 0;
			if (x.charAt(0) == '-') {
				neg = true;
				start++;
			}
			for (int i = start; i < x.length(); i++)
				if (x.charAt(i) == '.') {
					res = Long.parseLong(sb.toString());
					sb = new StringBuilder("0");
					dec = true;
				} else {
					sb.append(x.charAt(i));
					if (dec)
						f *= 10;
				}
			res += Long.parseLong(sb.toString()) / f;
			return res * (neg ? -1 : 1);
		}

		public boolean ready() throws IOException {
			return br.ready();
		}

	}
}