    //A,Elebereth Gilthoniel mantae!
    //For Temeria!
    #include<iostream>
    #include<algorithm>
    #include<cmath>
    #include<string>
    #include<vector>
    #include<set>
    #include<cstdio>
    #include<map>
    #include<stack>
    #include<queue>
    #include<cstring> 
	#pragma comment(linker, "/STACK:102400000,102400000")
    using namespace std;
     
    const int kk=26;
    vector<int> s[1<<kk]; 
    int dp[200000+18];int pa[200000+18];
    int main()
    {
     	//freopen("","r",stdin);
    	//freopen("","w",stdout);
    	string ss;cin>>ss;int t=0;
    	for(int i=0;i<ss.size();i++)
    	{
    		int a=ss[i]-'a';
    		if(((1<<a)&(t))) t-=1<<a;
    		else t+=1<<a;
    		s[t].push_back(i);
    		pa[i]=t;
    	}
    	for(int i=0;i<20000+15;i++) dp[i]=12345678;
    	dp[0]=1;
    	for(int i=0;i<ss.size();i++)
    	{
    		if(1)
    		{
    			int q=0;if(i!=s[pa[i]][s[pa[i]].size()-1]) q=*(lower_bound(s[pa[i]].begin(),s[pa[i]].end(),i+1));else q=0;
    			dp[q]=min(dp[i],dp[q]);
    			for(int j=0;j<kk;j++)
    			{
    				int y=pa[i];if((pa[i])&(1<<j))y-=1<<j;else y+=1<<j;
    				if(s[y].size()>0 and i<s[y][s[y].size()-1])q=*(lower_bound(s[y].begin(),s[y].end(),i));else q=0;
					dp[q]=min(dp[q],dp[i]+1);
    			}
    			//q=*(s[0].lower_bound(i));dp[q]=min(dp[q],dp[i]+1);
    		}	
    	}cout<<dp[ss.size()-1];
    	return 0;
    }