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
#include <bits/stdc++.h>
using namespace std;
long long int dis(long long int r1, long long int c1, long long int r2,
                  long long int c2) {
  return abs(r1 - r2) + abs(c1 - c2);
}
const long long int sz = (long long int)1e6 + 5;
char grid[501][501];
long long int pre[sz];
long long int dp[(1 << 20)] = {0};
bool vis[(1 << 20)] = {0};
bool found[(1 << 20)] = {0};
void add(long long int val) {
  if (vis[val]) return;
  vis[val] = true;
  if (found[val]) {
    dp[val] = __builtin_popcount(val);
    return;
  }
  long long int& ans = dp[val];
  ans = 0;
  for (long long int i = 0; i < 20; i++) {
    if ((val & (1 << i))) {
      add((val ^ (1 << i)));
      ans = max(ans, dp[(val ^ (1 << i))]);
    }
  }
}
void pre2() {
  for (long long int i = 1; i < (1 << 20); i++) {
    add(i);
  }
}
void set2(long long int& val, long long int bit) { val |= (1 << bit); }
void unset2(long long int& val, long long int bit) {
  val |= (1 << bit);
  val ^= (1 << bit);
}
bool is(long long int& val, long long int b) { return val & (1 << b); }
void bin(unsigned n) {
  unsigned i;
  for (i = 1 << 31; i > 0; i = i / 2) (n & i) ? printf("1") : printf("0");
  printf("\n");
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  string s;
  cin >> s;
  long long int vals = 0;
  long long int ans = 0;
  for (long long int i = 0; i < s.length(); i++) {
    long long int vals = 0;
    for (long long int chars = 1; chars <= min(20LL, i + 1); chars++) {
      if (vals & (1 << (s[i - chars + 1] - 'a')))
        break;
      else
        vals |= (1 << (s[i - chars + 1] - 'a'));
      found[vals] = true;
    }
    pre[i] = vals;
  }
  pre2();
  for (long long int i = 0; i < (long long int)(s.length()); i++) {
    ans =
        max(ans, __builtin_popcount(pre[i]) + dp[(~pre[i] & ((1 << 20) - 1))]);
  }
  cout << ans;
}
