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.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class Round590F {

	public static void solve() {
		String str = s.next();
		int n=str.length();
		int m=21;
		int[] dp =new int[1<<m];
		for(int i=0;i<n;i++) {
			int mask = 0;
			for(int j = i; j<=i+20 && j<n;j++) {
				int temp2=(1<<(str.charAt(j)-'a')) ;
				int temp =  (mask & temp2);
				if( temp> 0) {
					break;
				}else {
					mask |= (1<<(str.charAt(j)-'a'));
					dp[mask]=Integer.bitCount(mask);
				}
			}
		}
		for(int i=0;i<m;i++) {
			for(int mask = 0 ; mask < (1<<m) ; mask++) {
				if( (mask & (1<<i)) >0) {
					dp[mask]= Integer.max(dp[mask], dp[( mask ^ (1<<i))]);
				}
			}
		}
		int number = (1<<m) - 1;
		int ans = 0;
		for(int i=0;i<n;i++) {
			int mask = 0;
			for(int j = i; j<=i+20 && j<n;j++) {
				if((mask & (1<<(str.charAt(j)-'a'))) > 0) {
					break;
				}else {
					mask |= (1<<(str.charAt(j)-'a'));
					int newnumber = mask^number;
//					String str2 = Integer.toBinaryString(newnumber);
					ans = Integer.max(ans, dp[mask]+(dp[newnumber]));
				}
			}
		}
		out.println(ans);
	}

	public static void main(String[] args) {
		out = new PrintWriter(new BufferedOutputStream(System.out));
		s = new FastReader();
		solve();
		out.close();
	}

	public static FastReader s;
	public static PrintWriter out;

	public static class FastReader {
		BufferedReader br;
		StringTokenizer st;

		public FastReader() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		String next() {
			while (st == null || !st.hasMoreTokens()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}

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

		double nextDouble() {
			return Double.parseDouble(next());
		}

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

		String nextLine() {
			String str = "";
			try {
				str = br.readLine();
			} catch (Exception e) {
				e.printStackTrace();
			}
			return str;
		}
	}

	
}