#include using namespace std; struct cww{cww(){ios::sync_with_stdio(false);cin.tie(0);}}star; template istream& operator>>(istream &is,vector &v){ for(auto &it:v)is>>it; return is; } templatevoid chmin(T& a, T& b){a=min(a,b);} templatevoid chmax(T& a, T b){a=max(a,b);} typedef long long LL; LL calc(char a,char b,char c){ if(a=='0')return 0; if(b!=c||a==b)return 0; return (a-'0')*100+(b-'0')*10+(c-'0'); } int main(){ string S; cin>>S; int n=S.size(); LL res=0; vector dp(1< ord(1<__builtin_popcount(r);}); for(auto &bit:ord){ chmax(res,dp[bit]); for(int i=0;i