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 double PI = 2 * acos(0.0);
void yes() { cout << "YES\n"; }
void no() {
  cout << "NO\n";
  cout << -1 << "\n";
  exit(0);
}
long long m(long long a) { return (a + 1000000007) % 1000000007; }
long long cel(long long x1, long long y1) {
  ;
  if ((x1 % y1) == 0) return x1 / y1;
  return x1 / y1 + 1;
}
long long power(long long a, long long b) {
  if (b == 0) return 1;
  long long d = power(a, b / 2);
  d = m(d * d);
  if (b & 1) d = m(d * a);
  return d;
}
long long fun(long long mask) {
  long long ans = 0;
  while (mask) {
    ans += mask % 2;
    mask /= 2;
  }
  return ans;
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  string str;
  cin >> str;
  long long M = pow(2, 20) - 1;
  vector<long long> dp(M + 2, 0);
  vector<long long> mapp(M + 1, 0);
  long long n = str.size();
  vector<long long> vec;
  for (long long i = 0; i < n; i++) {
    long long mask = 0;
    for (long long j = i; j < n; j++) {
      long long d = str[j] - 'a';
      if ((mask & (1 << d)) > 0) break;
      mask |= (1 << d);
      if (mapp[mask] == 0) vec.push_back(mask);
      mapp[mask] = 1;
      dp[mask] = fun(mask);
    }
  }
  for (long long i = 1; i <= M; i++) {
    long long mask = i;
    if (dp[mask] != 0) continue;
    for (long long j = 0; j < 20; j++) {
      if ((mask & (1 << j)) > 0) {
        long long mask2 = mask ^ (1 << j);
        dp[mask] = max(dp[mask], dp[mask2]);
      }
    }
  }
  long long ans = 0;
  for (auto it : vec) {
    long long mask = it ^ M;
    ans = max(ans, dp[mask] + fun(it));
  }
  cout << ans << "\n";
  return 0;
}