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 CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
const long long MAXN = 1e5 + 5;
const long long mod = 1e9 + 7;
long long fact[MAXN];
long long invfact[MAXN];
bool sieve[MAXN];
long long powe(long long x, long long y, long long mod) {
  long long res = 1;
  while (y > 0) {
    if (y & 1) res = (res * x) % mod;
    y = y >> 1;
    x = (x * x) % mod;
  }
  return res;
}
void makesieve() {
  for (long long i = 0; i < MAXN; ++i) {
    sieve[i] = 1;
  }
  sieve[0] = 0;
  sieve[1] = 0;
  for (long long i = 2; i * i <= MAXN; ++i) {
    for (long long j = 2 * i; j < MAXN; j += i) {
      sieve[j] = 0;
    }
  }
}
void pre() {
  fact[0] = 1;
  invfact[0] = 1;
  for (long long i = 1; i < MAXN; ++i) {
    fact[i] = (fact[i - 1] * i) % mod;
    invfact[i] = powe(fact[i], mod - 2, mod);
  }
  makesieve();
}
long long comb(long long n, long long r) {
  if (r == 0 || n == r) return 1;
  if (r > n) return 0;
  long long A = (fact[n] * invfact[r]) % mod;
  return (A * invfact[n - r]) % mod;
}
long long gcde(long long a, long long b) {
  if (a == 0) return b;
  return gcde(b % a, a);
}
long long gcdExtended(long long a, long long b, long long *x, long long *y) {
  if (a == 0) {
    *x = 0, *y = 1;
    return b;
  }
  long long x1, y1;
  long long gcd = gcdExtended(b % a, a, &x1, &y1);
  *x = y1 - (b / a) * x1;
  *y = x1;
  return gcd;
}
long long modInverse(long long a, long long m) {
  long long x, y;
  long long g = gcdExtended(a, m, &x, &y);
  return (x % m + m) % m;
}
bool ifcontains(string str, string smlstr) {
  if (str.length() < smlstr.length()) return false;
  for (long long i = 0; i < str.length(); ++i) {
    bool fg = 0;
    for (long long j = 0; j < smlstr.length(); ++j) {
      if (i + j >= str.length()) {
        fg = 1;
        break;
      }
      if (smlstr[j] != str[i + j]) {
        fg = 1;
        break;
      }
    }
    if (!fg) return true;
  }
  return false;
}
int dp[1 << 20];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  string s;
  cin >> s;
  int arr[1 << 20];
  for (int i = 0; i < (1 << 20); ++i) {
    arr[i] = 0;
  }
  for (int i = 0; i < s.length(); ++i) {
    int num = 0;
    for (int j = i; j < s.length(); ++j) {
      if (num & (1 << (s[j] - 'a'))) break;
      num |= (1 << (s[j] - 'a'));
      arr[num] = 1;
    }
  }
  for (int i = 0; i < (1 << 20); ++i) {
    int ans = 0;
    if (arr[i] == 1) ans = __builtin_popcount(i);
    for (int j = 0; j < 20; ++j) {
      if (i & (1 << j)) {
        ans = max(ans, dp[i ^ (1 << j)]);
      }
    }
    dp[i] = ans;
  }
  int f_ans = 1;
  for (int i = 0; i < (1 << 20); ++i) {
    f_ans = max(f_ans, dp[i] + dp[(i ^ ((1 << 20) - 1))]);
  }
  cout << f_ans;
  return 0;
}