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;
#pragma GCC optimize("O3")
const int mods[10] = {1000000007, 999999937, 999999929, 999999893, 999999883,
                      999999797,  999999761, 999999757, 999999751, 999999739};
const int mod = 1000000007;
int rand_mods[2];
const long double eps = 1e-10;
const int siz = 1e6 + 10, siz2 = 15e5 + 5, lg = 21, block = 448, block2 = 1000,
          mxv = 5e5, sqrt_mod = 31630;
const int alpha_sz = 26;
char str[siz];
bool ex[siz2];
char dp[siz2], bcnt[siz2];
int get_bcnt(int mask) {
  int ret = 0;
  while (mask) {
    ret += mask & 1;
    mask >>= 1;
  }
  return ret;
}
char calc_bsmask(int mask, int bcnt) {
  char &ret = dp[mask];
  if (ret != -1) {
    return ret;
  }
  if (mask == 0) {
    return ret = 0;
  }
  if (ex[mask]) {
    return ret = bcnt;
  }
  for (int i = 0; i < 20; i++) {
    int smask = 1 << i;
    if (mask & smask) {
      ret = max(ret, calc_bsmask(mask & (~smask), bcnt - 1));
    }
  }
  return ret;
}
int main() {
  scanf("%s", str);
  int sz = strlen(str);
  for (int i = 0; i < sz; i++) {
    int mask = 0;
    for (int j = i;; j++) {
      if (j == sz) {
        break;
      }
      int smask = 1 << str[j] - 'a';
      if (mask & smask) {
        break;
      }
      mask |= smask;
      ex[mask] = 1;
    }
  }
  memset(dp, -1, sizeof dp);
  for (int i = 0; i < (1 << 20); i++) {
    bcnt[i] = get_bcnt(i);
    calc_bsmask(i, bcnt[i]);
  }
  int ans = 0;
  for (int i = 0; i < (1 << 20); i++) {
    if (ex[i]) {
      int inv = (~i) & (1 << 20) - 1;
      ans = max(ans, bcnt[i] + dp[inv]);
    }
  }
  printf("%d\n", ans);
  return 0;
}