//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> 
using namespace std;
#pragma comment(linker, "/STACK:102400000,102400000")
const int kk=27;
set<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].insert(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=*(s[pa[i]].lower_bound(i+1));
			if(s[pa[i]].lower_bound(i+1)!=s[pa[i]].end())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].lower_bound(i)==s[y].end()) continue;
				q=*(s[y].lower_bound(i));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;
}