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;
long long int MOD = 1000000007;
class ChainCity {
 public:
  int findNum(vector<int> &cities, int X) {
    int x = (X) / 2;
    int last = -1e9;
    int cnt = 0;
    for (auto city : cities) {
      if (abs(((int)city) - last) > x) {
        last = (city) + x;
        cnt++;
      }
    }
    return cnt;
  }
  int findMin(vector<int> &dist, int goal) {
    vector<int> cities;
    cities.push_back(0);
    for (auto x : dist) cities.push_back(cities.back() + x);
    for (auto &x : cities) x *= 2;
    int cur_size, X;
    for (cur_size = (int)cities.back() / 2, X = 0; cur_size > 0;
         cur_size /= 2) {
      if (findNum(cities, cur_size + X) > goal) {
        X += cur_size;
      }
    }
    return (X) / 2 + 1;
  }
};
int dp[(1 << 20)] = {0};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  string s;
  cin >> s;
  int n = s.length();
  int cur_mask;
  memset(dp, 0, sizeof(dp));
  for (int i = 0; i < n; i++) {
    cur_mask = 0;
    int j = i;
    while (j != n and !((cur_mask >> ((int)s[j] - 'a')) & 1)) {
      j++;
      cur_mask |= 1 << ((int)s[j - 1] - 'a');
      dp[cur_mask] = j - i;
    }
  }
  int ans = 0;
  for (int i = 1; i < (1 << 20); i++) {
    for (int bit = 0; bit < 20; bit++) {
      if ((i >> bit) & 1) dp[i] = max(dp[i], dp[i ^ (1 << bit)]);
    }
  }
  for (int i = 0; i < (1 << 20); i++) {
    int cur = i, comp = (1 << 20) - 1 - i;
    ans = max(ans, dp[cur] + dp[comp]);
  }
  cout << ans << "\n";
}