#include <iostream>
#include <string>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
using namespace std;
int main(int argc, char** argv) {
	string x;
	cin>>x;
	int f=0;
	if(x.length()<=26){
		cout>>0;
	}else if(x.length()==27){
		for(int i =0; i<x.length();i++){
			if(x[i]==x[i+1]) f=1;
		}
		if(f==0){
			cout<<1;
		}else{
			cout<<2;
		}
	}
	return 0;
}