#include<stdio.h>
#include<string.h>
const int max=1500000;
FILE *in=fopen("INPUT.TXT","r");;
FILE *out=fopen("OUTPUT.TXT","w");
int i;
int n;
int x;
int p[max];
int c[max];
char a[max];
void input(){
	fscanf(in,"%s",&a);
	n=strlen(a);
}
void process(){
	p[0]=-1;
	for(i=1;a[i]!=NULL;i++){
		x=i-1;
		p[i]=-1;
		while(x>=0){
			x=p[x];
			if(a[x+1]==a[i]){
				p[i]=x+1;
				break;
			}
		}
	}
	for(i=0;a[i]!=NULL;i++){
		c[i]=i+1;
		if(p[i]>=0){
			if(c[p[i]]==i-p[i]){
				c[i]=i-p[i];
			}
		}
	}
}
void output(){
	fprintf(out,"%d\n",c[n-1]);
}
int main(){
	input();
	process();
	output();
	fcloseall();
	return 0;
}

