Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.Hongcow has decided to try to make new words from this one. He starts by taking the word he just learned how to spell, and moves the last character of the word to the beginning of the word. He calls this a cyclic shift. He can apply cyclic shift many times. For example, consecutively applying cyclic shift operation to the word "abracadabra" Hongcow will get words "aabracadabr", "raabracadab" and so on.Hongcow is now wondering how many distinct words he can generate by doing the cyclic shift arbitrarily many times. The initial string is also counted.

The first line of input will be a single string s (1 ≤ |s| ≤ 50), the word Hongcow initially learns how to spell. The string s consists only of lowercase English letters ('a'–'z').

Output a single integer equal to the number of distinct strings that Hongcow can obtain by applying the cyclic shift arbitrarily many times to the given string.

NoteFor the first sample, the strings Hongcow can generate are "abcd", "dabc", "cdab", and "bcda".For the second sample, no matter how many times Hongcow does the cyclic shift, Hongcow can only generate "bbb".For the third sample, the two strings Hongcow can generate are "yzyz" and "zyzy".

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef bool bl;

#define pb push_back
#define pf push_front
#define pof pop_front
#define pob pop_back
#define ins insert
#define fast ios_base::sync_with_stdio(0); cin.tie(0);cout.tie(0);
#define sz size()

ll gcd(ll a, ll b){
    while(b) a %= b, swap(a, b);
    return a | b;
}

ll lcm(ll a, ll b){
    return a * b / gcd(a, b);
}

set < string > se;

string d;

int main()
{
	cin >> d;

	for(int it = 1; it <= (ll)d.size() + 2; it ++) {
		se.insert(d);
		char tmp = d.back();
		d.pob();
		d = tmp + d;
   }
   cout << (ll)se.size();
	return 0;
}

#include<bits/stdc++.h>
#define nn 1010
using namespace std;
string s[nn];
char a[nn];
int main(){
	scanf("%s", a);
	int n = strlen (a);
	for(int i = 0; i < n; i++){
		s[i] = a + i;
		a[n + i] = a[i];
	}
	sort(s, s + n);
	n = unique(s, s + n) - s;
	cout << n;
}

/*
Lionel Messi is such a player that you may catch him, you may touch him, you may feel him
and definitely you may Love him.
Lionel Messi is Messi. A little Magician in this World.

*/

#include<bits/stdc++.h>

using namespace std;

#define fast ios_base::sync_with_stdio(false)
#define bfast cin.tie(0)
#define outs(x) cout << x << " "
#define outn(x) cout << x << "\n"
#define sf scanf
#define pf printf
#define nl puts("")
#define psb push_back

typedef long long LL;
typedef vector<int>vii;
typedef vector<LL>vll;

const int mod = 1000007;
const int high = 100;

int main()
{
	fast;
	string s , tmp , parmanent;
	int len , i , j , cnt=0;
	while(cin >> s)
	{
		cnt=1;

		parmanent = s;

		len = s.length();

		i = len-1;

		tmp = s[i];

		for(j=0; j<i; j++)
		{
			tmp+=s[j];
		}

		while(tmp != parmanent)
		{
			cnt+=1;

			s = tmp;

			len = s.length();

			i = len-1;

			tmp = s[i];

			for(j=0; j<i; j++)
			{
				tmp+=s[j];
			}
		}

		cout << cnt << "\n";
	}

	return 0;
}

#include<bits/stdc++.h>
using namespace std;
char s[110];
int main(){
#ifndef ONLINE_JUDGE
	freopen("in.in","r",stdin);
#endif
	cin>>s;
	int len=strlen(s);
	set <string>p;
	for(int i=0;i<len;i++){
		p.insert(s+i);

		s[len+i]=s[i];
	}
	cout<<p.size();
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
#define int long long int
typedef long double ld;
#define forw(i,a,b) for(int i=a; i<b;i++)
#define rev(i,a,b) for(int i=a;i>=b;i--)
#define endl '\n'
#define ff first
#define ss second
#define all(a) a.begin(),a.end()
#define mxe max_element
#define mne min_element
#define pb push_back
#define mp make_pair
#define vi vector<int>
#define pi pair<int,int>
#define size(a) (int)(a.size())
int inf=1e9;
const int mod = 1e9 + 7;
vector<bool> visited(1e5 +1);
int cats=0;
int ans=0;

void solve(){
    string s;
    cin>>s;
    int n=size(s);
    set<string> se;
    se.insert(s);
    int ans=1;
    forw(i,1,n){
        string temp= s.substr(n-i,i) + s.substr(0,n-i);
        if(!se.count(temp)){
        	se.insert(temp);
        	ans++;
        }
    }
    cout<<ans;

}

signed main(){
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    //
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
    //
	int test;
	//cin>>test;
	test=1;
	while(test--){
         solve();
         cout<<endl;
	}
}

#include <bits/stdc++.h>
using namespace std;
typedef long long int lng;
void doit()
{
    string s;
    cin >> s;
    int len = s.length(), ct = 1;
    string dup = s;
    s = s.substr(1, len) + s.substr(0, 1);
    while (dup != s)
    {
        s = s.substr(1, len) + s.substr(0, 1);
        ct++;
    }
    cout << ct << endl;

}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(NULL);
    doit();
    return 0;
}

#include <bits/stdc++.h>
#define endl '\n'
#define ALL(V) V.begin(), V.end()
#define L_B lower_bound
#define U_B upper_bound
#define pb push_back
#define ll long long
#define rep(i,n) for (i = 0; i < n; ++i)
#define REP(i,k,n) for (i = k; i <= n; ++i)
#define REPR(i,k,n) for (i = k; i >= n; --i)
using namespace std;
template<class T, class T1> int chkmin(T &x, const T1 &y) { return x > y ? x = y, 1 : 0; }
template<class T, class T1> int chkmax(T &x, const T1 &y) { return x < y ? x = y, 1 : 0; }
const int MAXN = (1 << 20);

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
#ifndef ONLINE_JUDGE
   freopen("input.txt", "r", stdin);
   //freopen("error.txt", "w", stderr);
   freopen("output.txt", "w", stdout);
#endif

 ll T = 1 ;
 //cin>>T;

 for(ll t=0;t<T;t++)
 {
  string s;
  cin>>s;
  string ts = s;
  ll f = 0 ,n = s.size() , ans = 1;
  for(ll i=0;i<n;i++)
  {
    char ch = ts[n-1];
    for(ll j=n-1;j>=1;j--)
      ts[j] =ts[j-1];
    ts[0] = ch;
    //cout<<ts<<" "<<s<<" ";
    if(ts==s)
      break;
    ans++;

  }

  cout<<ans;

 }
  return 0;

}

#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <math.h>
#include <vector>
#include <iomanip>
#include <set>
#include <string>
#include <stdio.h>
#include <string.h>
using namespace std;

int main()
{
	//freopen("buy.in", "r", stdin);
	string  b, an = "" , cp;
	int coun = 1 ;
	cin >> b;
	cp = b;
	for (int i = 0; i < b.size()-1; i++)
	{
		an += cp[b.size() - 1];
		for (int j = 0; j < b.size()-1; j++)
			an += cp[j];
		if (an == b)
			break;
		else
		{
			coun++;
			cp = an;
		}
		an = "";
	}
	cout << coun << endl;
	return 0;
}

#include <cstdio>
#include <algorithm>
#include <iostream>
#include <math.h>
#include <vector>
#include <queue>
#include <cstring>
#include <map>
using namespace std;
#define maxn 55
char s[maxn][maxn];

int main()
{
	scanf("%s", s[0]);
	int n = strlen(s[0]);
	for (int i = 1; i < n; i++){
		for (int j = 0; j < n - 1; j++){
			s[i][j] = s[i - 1][j + 1];
		}
		s[i][n - 1] = s[i - 1][0];
	}
	int ans = 0;
	for (int i = 0; i < n; i++){
		int flag = 1;
		for (int j = 0; j < i; j++){
			if (strcmp(s[i], s[j]) == 0)
				flag = 0;
		}
		if (flag) ans++;
	}
	cout << ans << endl;

	return 0;
}

/// 745A - Hongcow Learns the Cyclic Shift	(Codeforce) 3 cach
/// String , Chuoi Vong, Sinh chuoi, Dem chuoi ko trung. STL Set
/// Cach 2 tot nhat, dung STL SET (tap hop cac phan Tu KHAC BIET)
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
const int maxn=200003;

string s,ss;
int n;
set <string> st;
int main()
{
 //   freopen("nhap.inp", "r", stdin);
    cin>>s;
    n=s.length();
    ss=s+s;                     ///Cach de Sinh cac chuoi con cua Chuoi Vong abcdabcd --> abcd,bcda,cdab,dabc
    for (int i=0; i<n; i++)
        st.insert( ss.substr(i,n) );
    cout<<st.size();
    return 0;
}

#include<bits/stdc++.h>

using namespace std;
set <string> st;
int main()
{
    string s;
    cin >> s;
    string a = s + s;
    for(int i = 0;i < a.size() - s.size();i++)
    {
        string k="";
        for(int j = i;j < i + s.size();j++)
            k += a[j];
        st.insert(k);
    }
    cout << st.size();
}

#include<bits/stdc++.h>
using namespace std;
string s,s1;
map<string,int>ans;
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    cin>>s;
    int c=0,k=0;
    while(c!=s.size()){s1="";
        for (int i=0; i<s.size()-1; ++i){
            s1+=s[i];
        }   s1=s[s.size()-1]+s1;
        if (ans[s1]==0) k++,ans[s1]=1;
        s=s1;
    c++;}
    cout<<k;

}

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    string s, s1, s2; cin >> s; queue<char> qu; qu.push(s[0]); bool flag = true; int ind = -1;
    s1 = s.substr(0, s.size() / 2);
    s2 = s.substr(s.size() / 2);
    if(s1 == s2)
    {
        for(int i=0; i<s1.size(); i++)
        {
            s += s1[i];
        }
    }
    //cout << s1 << " " << s2 << " " << s << "\n";
    for(int i=1; i<s.size(); i++)
    {
        if(qu.front() == s[i]) {qu.pop();}
        qu.push(s[i]);
    }
    int cycle = qu.size();

    /*queue<char> qu2 = qu; string str = "";
    while(!qu2.empty())
    {
        cout << qu2.front() << " ";
        str += qu2.front();
        qu2.pop();
    }*/

    while(!qu.empty())
    {
        if(s[++ind] != qu.front()) {flag = false; break;}
        qu.pop();
    }
    flag == true ? cout << cycle : cout << s.size();
    return 0;
}

/*Every skill you acquire doubles your odds of success.*/
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;

#define mp make_pair
#define pb push_back
#define f(i,a,b) for(i=a;i<b;i++)

#define mod 1000000007
#define fi first
#define se  second
#define faster ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)

int main()
{
    faster;
    string s;
    cin>>s;
    ll n=s.size(),i;

    s=s+s;

    set<string>se;

    for(i=0;i<n;i++)
    {
        se.insert(s.substr(i,n));
    }
       //set<string>::iterator it;
       //for(it=se.begin();it!=se.end();it++)
      // cout<<*it<<endl;
    cout<<se.size()<<endl;
}

#include <bits/stdc++.h>

using namespace std;

int main()
{
	string s;
	while(cin>>s)
	{
	set<string>t;
	string so=s;

	t.insert(so);
        s+=s;
	                  for(int i=(int)so.size();i<s.size();i++)
	            {
	   so.erase(0,1);
	   so+=s[i];
	   t.insert(so);
	}
	cout<<t.size()<<endl;
	}
}

/*
ID: Khalid
PROG:
LANG: C++
*/

#include <algorithm>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <math.h>
#define CASET int ___T, case_n = 1; scanf("%d ", &___T); while (___T-- > 0)
using namespace std;
int main()
{

	//freopen("D://input.txt","r",stdin);
	//freopen("D://output.txt","w",stdout);
    string s1,s2,s;
    int t,i,ln;
    cin>>s;
    t = 0;
    s1 = s;

    ln = s.size();

    while(1)
    {
    	s2 = "";
    	s2+= s1[ln-1];
    	for(i=1;i<ln;i++)
    	{
    	  	s2+=s1[i-1];
    	}
    	t++;
    	if(s2==s)
    	{
    		break;
    	}
        s1=s2;
    }
    cout<<t<<endl;

    return 0;

}

#include<algorithm>
#include<iostream>
#include<string.h>
#include<map>
using namespace std;
int main()
{
    map<string,int>mp;
    int i,n,sum,x,j,c=0;
    string ar;
    cin>>ar;
    sum=ar.size();
    i=ar.size();
    while(sum--)
    {
        mp[ar]++;
        if(mp[ar]==1)  c++;
        for(j=i-2;j>=1;j--)
        {
            if(j==i-2) x=ar[i-2];
            ar[j]=ar[j-1];

        }
        ar[0]=ar[i-1];
        ar[i-1]=x;
        //cout<<ar<<endl;
    }
    cout<<c<<endl;
    return 0;
}

#include<stdio.h>
#include<string.h>
char s[200];
int main()
{  int len,i;
    while(~scanf("%s",s))
    {
        len=strlen(s);
        for( i=1; i<=len; i++)
        {
            if(len%i==0)
            {
                int ok=1;
                for(int j=i; j<len; j++)
                {
                    if(s[j]!=s[j%i])
                    {
                        ok=0;
                        break;
                    }
                }
                if(ok)
                {
                    printf("%d\n",i);
                    break;
                }
            }
        }
    }

}

#include <stdio.h>
#include <math.h>
#include <algorithm>
#include <string>
#include <queue>
#include <map>
#include <iostream>
using namespace std;
#define rd(a) scanf("%d", &a);
#define rdl(a) scanf("%ld", &a);
// #define LL long long
// #define eps 1e-8
//#define maxn 3000*1500+100
// #define inf 0x3f3f3f3f
using namespace std;

map <string, int> dist;

int main(){

	int ct = 1;
	string line, line1;
	cin >> line;

	dist.clear();
	dist[line] = 1;
	int len = 0;
	len = line.length();
	for(int i=0;i<55;i++){
		if(line[i]=='\0'){
			len = i;
			break;
		}
	}
	for(int i=0;i<len;i++){
		line1 = line.substr(i, len-i) + line.substr(0, i);
		if(!dist[line1]){
			ct++;
			dist[line1]=1;
		}
	}

	printf("%d", ct);

}

#include<bits/stdc++.h>
#define x first
#define y second
#define rep(i,a,b) for(int i=a;i<=b;i++)

using namespace std;
typedef long long INT;
typedef vector<int> vec;
typedef pair<int,int> pi;
char s[100],b[100];
char a[100];
int main(){
#ifndef ONLINE_JUDGE
	freopen("in.in","r",stdin);
	freopen("out.out","w",stdout);
#endif
	cin>>s;
	int n=strlen(s);
	for(int i=0;i<n;i++) a[i]=s[i];
	for(int r=1;r<=n;r++){
		for(int i=1;i<n;i++) b[i]=a[i-1];
		b[0]=a[n-1];
		for(int i=0;i<n;i++) {
			if(s[i]!=b[i]) break;
			if(i==n-1) {cout<<r<<endl;return 0;}
		}
		for(int i=0;i<n;i++) a[i]=b[i];
	}
}

#include<bits/stdc++.h>
#define ll long long
#define endl "\n"
#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);
#define vector(a,b,c) vector<a>b(c)
#define For(a,b,c) for(int a=b;a<c;a++)
#define pb push_back
#define mp make_pair
#define dispMap(a) for(auto it=a.begin() ; it!= a.end() ; it++) {cout << it->first << "  " << it->second << endl; }
#define dispVector(a) for(auto it = a.begin() ; it!= a.end() ;it++) {cout << *it << endl;}

using namespace std;

int main() {
    IOS
    string s;
    getline(cin >> ws,s);
    set<string>count;

    int n = s.size();
    for(int i=0;i<n;i++) {
        string a = "";
        int k = s.size() - 1;
        for(int j=0;j<n;j++) {
             a += s[k];
             k++;
             k = k % n;
        }
        s = a;
        count.insert(a);
    }
    cout << count.size() << endl;
}

#include <bits/stdc++.h>
#define ll long long
#define RAED ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define Solve()  main()
using namespace std;
void Input_Element_Array(int Array1[],int n)
{
    for(int i=0; i<n; i++)
        cin>>Array1[i];
}
void sorted_Array(int Array1[],int n)
{
    sort(Array1,Array1+n);
}
int  GCD (int x,int y)
{
    if(x==0||y==0)
        return abs(x-y);

    while(x!=y)
        if(x>y)
            x=x-y;
        else
            y=y-x;
    return x;

}
int Function (int x)
{
    int Answer=1;
    for(int i=1; i<=x; i++)
        Answer*=i;
    return Answer;
}
void Lower_String (string s)
{

    for(int in=0;in<s.size();in++)
            s[in]=tolower(s[in]);

}
void Upper_String (string s)
{
    for(int i=0;i<s.size();i++)
        s[i]=toupper(s[i]);
}
void Input_Even_and_Odd_Element_To_Array(long long Array1[],long long n)
{
    long long v=0;
    for(long long i=2; i<=n; i++)
    {
        if(i%2==0)
        {
            Array1[v]=i;
            v++;
        }
    }
    for(long long i=2; i<=n; i++)
    {
        if(i%2!=0)
        {
            Array1[v]=i;
            v++;
        }
    }
}

/*░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
░░░░░░░░░░░░░░░░░░░░░▓████████████████████████▒░░░░░░░░░░░░░░░░░░░░
░░░░░░░░░░░░░░░░░░▓█████▓▒░░░░░░░░░░░░░░░▒██████▒░░░░░░░░░░░░░░░░░░
░░░░░░░░░░░░░░░░████▒░░░░░░░░░░░░░░░░░░░░░░░░░▓███▒░░░░░░░░░░░░░░░░
░░░░░░░░░░░░░░░███░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░███░░░░░░░░░░░░░░░
░░░░░░░░░░░░░▒██░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▒██░░░░░░░░░░░░░░
░░░░░░░░░░░░▒██░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░██░░░░░░░░░░░░░
░░░░░░░░░░░░██░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░██░░░░░░░░░░░░
░░░░░░░░░░░██▓░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▒░░██░░░░░░░░░░░░
░░░░░░░░░░░██░░██░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░██░░██░░░░░░░░░░░
░░░░░░░░░░░██░░██░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░██░░██░░░░░░░░░░░
░░░░░░░░░░░██░░██░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░██░░██░░░░░░░░░░░
░░░░░░░░░░░██▒░██▓░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░██▓░▒██░░░░░░░░░░░
░░░░░░░░░░░░██░░██░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░██░░██░░░░░░░░░░░░
░░░░░░░░░░░░██▒░██░░░░░▒▒▓███▒░░░░░░░▒███▓▒▒░░░░░██░▓██░░░░░░░░░░░░
░░░░░░░░░░░░░██░██░░██████████▒░░░░░▓██████████░░██▒██░░░░░░░░░░░░░
░░░░░░░░░░░░░░████░████████████░░░░░████████████░████░░░░░░░░░░░░░░
░░░░░░░░░░░░░░░███░▒██████████░░░░░░░██████████▒░██▒░░░░░░░░░▒░░░░░
░░░▒████░░░░░░░▓█▒░░█████████░░░░░░░░░█████████░░▒█▓░░░░░░▓████░░░░
░░░██░▒██▒░░░░░██░░░░██████▓░░░░█░█░░░░███████░░░░██░░░░░███░░██░░░
░░░██░░░██▓░░░░██░░░░░░▒▓▓░░░░▒██░██░░░░░▓▓▒░░░░░▒██░░░░███░░░██░░░
░▓██▒░░░░████▓░░██░░░░░░░░░░░░███░███░░░░░░░░░░░░██░░█████░░░░▓██▒░
██▓░░░░░░░░▒████████▓░░░░░░░░████░███▓░░░░░░░▒▓████████░░░░░░░░░███
██▓▒▓███▓░░░░░░▓████████▓░░░░████░███▓░░░░▓████████▓░░░░░░████▓▓███
░███████████▒░░░░░░███████░░░░██░░░██░░░░██████▓░░░░░░▓███████████░
░░░░░░░░░░▓█████░░░░██▓▓░██░░░░░░░░░░░░░██░█▒██░░░▒█████▓░░░░░░░░░░
░░░░░░░░░░░░░▒█████▒▒█▓█░███▓▓▒▒▒▓▒▒▓▓▓███▒███░▓█████░░░░░░░░░░░░░░
░░░░░░░░░░░░░░░░░▒████▒▓█▒▒█░█▒█░█░█▓█▒█▓░█░█████▒░░░░░░░░░░░░░░░░░
░░░░░░░░░░░░░░░░░░░░██░░██▓█▓█▓█▒█▒█▓█▓████░▓█▓░░░░░░░░░░░░░░░░░░░░
░░░░░░░░░░░░░░░░░▓████▓░▓█▓█░█▒█░█░█▒█▒███▒░██████░░░░░░░░░░░░░░░░░
░░░░░░░░░░░░░▓█████░░██░░░▒█████▓█▓█████▒░░░██░▒█████▓░░░░░░░░░░░░░
░░░░▒██████████▓░░░░░███░░░░░░░░░░░░░░░░░░░██▒░░░░░▓██████████▒░░░░
░░░░██░░░▓▓▓░░░░░░▒██████▓░░░░░░░░░░░░░░░███████▒░░░░░░▓▓▒░░▒██░░░░
░░░░▓██░░░░░░░░▓████▓░░░█████▒░░░░░░▒▓█████░░░▓████▓░░░░░░░▒██▓░░░░
░░░░░░███░░░░████▒░░░░░░░░▓█████████████▒░░░░░░░░▒████░░░░███░░░░░░
░░░░░░░██░░░██▒░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓██░░░██░░░░░░░
░░░░░░░██▒▓██░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▒██▒▓██░░░░░░░
░░░░░░░░████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░████░░░░░░░░
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░*/

int Solve()
{
    RAED;
    ///RAED_ALMASRE
    set <char>R;
    string s;
    cin>>s;
    string Answer=s+s;
    cout<<Answer.find(s,1);

}

#include<bits/stdc++.h>
using namespace std;
char s[110];
int main(){
#ifndef ONLINE_JUDGE
	freopen("in.in","r",stdin);
#endif
	cin>>s;
	int len=strlen(s);
	set <string>p;
	for(int i=0;i<len;i++){
		p.insert(s+i);

		s[len+i]=s[i];
	}
	cout<<p.size();
	return 0;
}

#include <bits/stdc++.h>

using namespace std;

int main(){
	string p, q;
	set<string> s;

	cin >> p;

	q = p;

	for(int i = p.size() - 1; i >= 0; i--){
		q = p[i] + q.substr(0, q.size() - 1);
		s.insert(q);
	}

	cout << s.size() << endl;

	return 0;
}

#include <bits/stdc++.h>

using namespace std;

int main()
{ string s,s2;
     cin>>s;
      s2=s+s;
    cout<<s2.find(s,1);
 return 0;
}

#include <iostream>
#include <cstdio>
#include <cctype>
#include <algorithm>
#include <cstring>
#include <string>
#include <cmath>

using namespace std;

int main()
{
    string a;
    getline(cin,a);
    int i, j, n = a.length(), ans = n;
    for(i = 1; i < n; i++){
        if(n % i != 0)continue;
        for(j = 0; j + i < n; j++){
            if(a[j] != a[j + i])break;
        }
        if(j + i == n){
            ans = i;
            break;
        }
    }
    printf("%d\n",ans);
    return 0;
}

/*
ID: Khalid
PROG:
LANG: C++
*/

#include <algorithm>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <math.h>
#include <cstring>
#define CASET int ___T, case_n = 1; scanf("%d ", &___T); while (___T-- > 0)
using namespace std;

int main()
{

	string s,temp1,temp2;
	int i,val,n,ln;
	cin >> s;
    ln  = s.length();
	val = 1;
    temp1 = s;
    while(1)
    {
       temp2 = temp1;
       temp2[0] = temp1[ln-1];
       for(i=0;i<ln-1;i++)
       {
    	   temp2[i+1] = temp1[i];
       }
       if(s == temp2)
       {
    	   break;
       }
       val++;
       temp1 = temp2;

    }
    cout << val << endl;
    return 0;

}

#include<bits/stdc++.h>
#define N 1000
#define TIME ios_base::sync_with_stdio(0)
#define ll long long
#define N 1000005
using namespace std ;
string a;
set<string> x;
int main () {
        TIME;
        cin>>a;
        for(ll i=1; i<=a.size(); i++){
        for(ll j=0; j<a.size()-1; j++){
                swap (a[j],a[j+1]);
                        }
                x.insert(a);
        }

        cout<<x.size();
}

#include <bits/stdc++.h>
#define F first
#define S second
#define maxn 200005
using namespace std;

string s;

int main()
{
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    //freopen("INP.TXT", "r", stdin);
    cin >> s;
    int n = s.length(), res = 1;
    string w = s[n-1] + s.substr(0, n-1);
    while (s != w)
    {
        res++;
        w = w[n-1] + w.substr(0, n-1);
    }
    cout <<res;
}

#include<bits/stdc++.h>
using namespace std;

int main()
{
    string str;
    cin>>str;
    char ch;
    int i,j,k,l,x=1;
    int len = str.length();
    string arr[len+1];
    arr[0] = str;
    int flag = 0,cnt = 1;
    for(i=0;i<len;i++)
    {
        flag = 0;
        char ch = str[0];
        for(j=0;j<len-1;j++)
        {
            str[j] = str[j+1];
        }
        str[j] = ch;
        //cout<<str<<endl;
        for(k=0;k<x;k++)
        {
            if(arr[k]==str)
            {
                flag = 1;
                break;
            }
        }
        if(flag==0) cnt++;
        arr[x] = str;
        x++;
    }

    cout<<cnt<<endl;

    return 0;
}

#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <set>

using namespace std;

int main()
{
	string s;
	cin >> s;
	set<string> k;
	for (int i = 0; i < s.length(); i++)
	{
		s = s.substr(s.length() - 1, 1) + s.substr(0, s.length() - 1);
		k.insert(s);
	}
	cout << k.size();
	//system("pause");
	return 0;
}

#pragma comment(linker, "/STACK:256000000")

#define _USE_MATH_DEFINES
#define _CRT_SECURE_NO_DEPRECATE

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <set>
#include <map>
#include <cstring>
#include <string>
#include <utility>
#include <vector>
#include <fstream>
#include <iterator>
#include <functional>
#include <queue>

using namespace std;
string s[51];

int main()
{
#ifdef DEBUG
	freopen("input.txt", "rt", stdin); freopen("output.txt", "wt", stdout);
#endif
	cin >> s[0];

	int n = s[0].length();
	int k = 1;
	for (int i = 0; i < n+1; i++)
		s[i] = s[0];
	for (int i = 0; i < n; i++)
	{
		char c = s[i][0];
		for (int j = 0; j < n-1; j++)
			s[i+1][j] = s[i][j + 1];
		s[i+1][n - 1] = c;
		bool found = false;
		for (int j = 0; j < n; j++)
			if ((s[i + 1] == s[j]) && (i + 1 != j))
				found = true;
		if (!found)
			k++;
	}
	cout << k;
	return 0;
}

#include<stdio.h>
#include<string.h>

int main(){
	char A[55], B[55];
	bool beda=true;
	scanf("%s", A);

	int len=strlen(A), hasil=1;
	for(int i=len; i<=55; i++){
		B[i]='\0';
	}

	for(int i=1; i<len && beda==true; i++){
			B[0]=A[len-i];

			for(int j=1; j<len; j++){
				(j-i<0)? B[j]=A[j-i+len]:B[j]=A[j-i];
			}
			(strcmp(A,B)==0)? beda=false : hasil++;

	}

	printf("%d\n", hasil);

}

#include<iostream>
#include<bits/stdc++.h>
#include<algorithm>
#define Read_Fast    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define PI acos(-1)
#define all(a) a.begin(),a.end()
#define f first
#define s second
#define pb push_back
#define ppb pop_back
#define pf push_front
#define ppf pop_front
#define mp make_pair
#define f0(i,n) for(i=0;i<n;i++)
#define f1(i,n) for(i=1;i<n;i++)
#define f1n(i,n) for(i=1;i<=n;i++)
#define szf sizeof()
#define sz size()
#define ln length()
using namespace std;
using ll=long long;
const int N=2e5+5;
//ll cum[N+4];
int main()
{
     Read_Fast
    string str;
    cin>>str;
    set<string>s;
   // vector<char>vec;
    int len=str.size();
    string flag;
    s.insert(str);
    for(int i=0;i<len;i++)
    {
        flag.push_back(str[len-1]);
        for(int j=0;j<len-1;j++)
        {
             flag.push_back(str[j]);
          //   cout<<endl<<flag<<endl<<endl;
        }
        s.insert(flag);
       // cout<<"set print "<<endl;
       /* for(auto x:s)
        {
            cout<<x<<endl;
        }
          cout<<"set print end"<<endl<<endl;*/
        str=flag;
        flag.clear();
    }

      cout<<s.size()<<endl;

/*
    for(int i=0; i<len; i++)
    {
        if(s.count(str[i]))
        {
            continue;
        }
        else
        {
            s.insert(str[i]);
            vec.pb(str[i]);
        }
    }
    if(s.size()==len)
    {
        cout<<len<<endl;
    }
    else if(s.size()==1)
    {
        cout<<1<<endl;
    }
    else
    {
        int ans=0;
        int l=vec.size();
       // cout<<l<<endl;
        for(int i=0,j=len-1; i<l; i++,j--)
        {
            if(vec[i]==vec[j])
            {
                break;
            }
            else
            {
                ans++;
            }
        }
        cout<<ans<<endl;
    }*/
    return 0;
}

#include<iostream>
#include<deque>
#include<stdio.h>
#include<vector>
#include<string>
#include<algorithm>
#define ll long long int
#define trusiki string
#define mod 1000000009
using namespace std;

vector <string> lib;
bool ident(string a) {
	bool res = true;
	for (int i = 0;i < lib.size();i++) {
		if (lib[i] == a) {
			res = false;
			break;
		}
	}
	return res;
}

string turn(string a) {
	string b;
	b+= a[a.length()-1];
	for (int i = 0;i < a.length()-1;i++) {
		b += a[i];
	}
	return b;
}

int main() {
#pragma warning (disable:4996)
#ifdef _DEBUG
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	string a;
	cin >> a;
	int count = 1;
	lib.push_back(a);
	for (int i = 1;i < a.length();i++) {
		string tmp = turn(lib.back());
		if (ident(tmp)) count++;
		lib.push_back(tmp);
	}
	cout << count;
	return 0;
}
//Любой ребенок от 3-х лет может нарисовать смешарика хать зубами

#include <iostream>
#include<string.h>
using namespace std;

int main()
{
    int i,cnt=0,len;
    char str[55],temp[55];
    char ch;

    cin >> str;
    len = strlen(str);
    strcpy(temp,str);

    int n = len;
    for(int j=0;j<len;j++){
    for(i=1;i<len;i++){
            ch = temp[n-i];
            temp[n-i] = temp[n-1-i];
            temp[n-1-i] = ch;
    }
    if(strcmp(str,temp) == 0) break;
     cnt++;
     //cout <<j+1 << temp << endl;
    }

    if(cnt == 0){
        cout << 1 << endl;
    }else{
        cout << cnt +1 <<endl;
    }

    return 0;
}

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define f first
#define s second
string next(string x){
    return string(1,x.back())+x.substr(0,x.size()-1);
}
int main(){
	string s;
	cin>>s;
	set<string>S;
	S.insert(s);
	string tmp=s;
	do{
        tmp =next(tmp);
        S.insert(tmp);

	}while(s!=tmp);
	cout<<S.size()<<endl;
}

#include <bits/stdc++.h>

#define LL long long
using namespace std;
int main(){
    int T,cnt=0;
    string a,b;
    cin>>a;
    int len=a.size();
    a+=a;
    set<string> str;
    for(int i=0;i<len;i++){
        string s=a.substr(i,len);
        str.insert(s);
    }
    printf("%d\n",str.size());
    return 0;
}

#include<stdio.h>
#include<string.h>
void cycle(char s[],int len)
{
	char temp=s[len-1];
	int i;
	for(i=len-1;i>0;i--)
	{
		s[i]=s[i-1];
	}
	s[0]=temp;
}
int main(){
	char s[51],orig[51];
	int len,count=0;
	scanf("%s",s);
	len=strlen(s);
	strcpy(orig,s);
	do
	{
		cycle(s,len);
		count++;
	}
	while(strcmp(orig,s));
	printf("%d\n",count);
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
#define SORT(c) sort((c).begin(),(c).end());
#define pb push_back
#define MP make_pair
#define pii pair<int,int>
#define pcc pair<char,char>
#define pic pair<int,char>
#define pci pair<char,int>
#define VS vector<string>
#define VI vector<int>
#define VL vector < ll >
#define pi 3.141592653589793
#define ll long long
#define ull unsigned long long
#define w(x) int x;cin>>x;while(x--)
#define fast ios_base::sync_with_stdio(0)
#define sz size()
#define cu cout<<
#define en endl
#define sp " "
#include<cstdio>
#include<cstring>
void bug()
{
    cout << "here\n";
}
typedef unsigned long long UL;
template<typename T>inline T  S(T a)
{
    return a*a;
}
template<class T>inline string tostring(T a)
{
    ostringstream os("");
    os << a;
    return os.str();
}
template<typename T>inline ll tolong(T a)
{
    ll res;
    istringstream os(a);
    os>>res;
    return res;
}
template<typename T>inline T gcd(T a, T b)
{
    if (b == 0)return a;
    else return gcd(b, a % b);
}
template<typename T>inline T bigmod(T a, T b, T m)
{
    if (b == 0)return 1;
    else if (b % 2 == 0)return S(bigmod(a, b / 2, m)) % m;
    else return (a % m*bigmod(a, b - 1, m)) % m;
}
const int inf = (int)1e9 + 5;
const ll linf = (ll)1e16 + 5;
const ll modd = (ll)1e9 + 7;
const int mod = 10000007;
#define N 10000009
bool prime[N];
vector<ll> prm;
void seive ()
{
    memset(prime, true, sizeof(prime));

    for( ll i=2; i*i<=N; i++)
    {

        if (prime[i] == true)
        {
            for (ll j=i*i; j<=N; j += i)
                prime[j] = false;
        }
    }
    for (ll i=2; i<=N; i++)
    {
        if(prime[i]) prm.pb(i);
    }
}
void pr (int f)
{
    if(f==1)
        cout<<"YES\n";
    else
        cout<<"NO\n";
}
bool isprime(ll n)
{
    if(n<2) return 0;
    if(n==2) return 1;
    else
    {
        for(int i=2; i*i<=n; i++)
            if(n%i==0) return 0;
    }
    return 1;

}

ll countSum(ll x)
{
    ll res = 0;
    while (x != 0)
    {
        res += (x % 10);
        x /= 10;
    }
    return res;
}
const int nx = 2e6+5;

ll power(ll a,ll b)
{
    if(b==0) return 1;
    if(b==1) return a;
    else
    {
        ll  res = power(a,b/2);
        if(b%2)
            return res * a*res;
        else
            return res*res;
    }
}

bool is_palin(string s)
{
    int n = s.size();
    for (int i = 0; i < n; i++)
        if (s[i] != s[n - i - 1])
            return 0;
    return 1;
}
int ar[5];
int main()
{
    fast;
    string s;
    cin >>s;
    set < string > st;
    for( int i =0; i< 100 ; i++)
    {
        string k = "";
        k+=s[s.sz-1];
        for (int j=0;j<s.sz-1;j++)
            k+=s[j];
        //cout << k <<endl;
        st.insert(k);
        s = k;
    }

    cout << st.sz;
}

#include<iostream>
#include<set>
using namespace std;
int main()
{
  string s;
  cin>>s;
  set<string> s1;
  int n= s.size();
  for (int i=0;i<s.size();i++ )
  {
    s1.insert(s.substr(i)+s.substr(0,i));
    //cout<<s.substr(i)+" "+  s.substr(0,i);
    // leave the first part of the string and add it behind to generate a cycle !!!

  }
  cout<<s1.size();
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
    string s,c;
    cin>>s;
    c=s;
    int n=s.size();
    int count=1;
    string t="";
    while(1){
        t+=c[n-1];
        for(int i=0;i<n-1;i++) t+=c[i];
        c=t;
        t="";
        if(c==s) break;
        count++;
    }
    cout<<count<<endl;
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
int main(){
	int T,cnt=0;
	string a,b;
    cin>>a;
    int len=a.size();
    a+=a;
    set<string> str;
    for(int i=0;i<len;i++){
            string s=a.substr(i,len);
            str.insert(s);
        }
    printf("%d\n",str.size());
        return 0;
    }

#include<iostream>
#include<fstream>
#include<sstream>
#include<stdio.h>
#include<iomanip>
#include<cmath>
#include<cstring>
#include<string>
#include<algorithm>
#include<assert.h>
#include<vector>
#include<stack>
#include <utility>
#include<set>
#include<bitset>
#include<queue>
#include<map>
#include<valarray>
#include<numeric>
using namespace std;
#define pi 3.14159265359
#define pb push_back
#define po pop_back
#define pf push_front
#define mp make_pair
#define all(v) ((v).begin()),((v).end())
#define sz(v) (int)v.size()
#define st first
#define nd second
#define max3(a,b,c) max(a,max(b,c))
#define min3(a,b,c) min(a,min(b,c))
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vint;
typedef vector<string> vstr;
void fast()
{
	std::ios_base::sync_with_stdio(0);
	cin.tie(NULL); cout.tie(NULL);
}
bool sortPairsCmp(const pair<int, int>&a, const pair<int, int>&b)
{
	return a.first*b.second < a.second*b.second;
}
int toInt(string str)
{
	int num;
	istringstream iss(str);
	iss >> num; return num;
}
template<class T> string toStr(T par)
{
	ostringstream oss;
	oss << par;
	return oss.str();
}
string toBinary(int n)
{
	std::string r;
	while (n) { r = (n % 2 == 0 ? "0" : "1") + r; n /= 2; }
	return r;
}
int count_true_bits(int a)
{
	int mask;
	int count = 0;
	for (mask = 1; mask; mask <<= 1)
	{

		if (mask & a) ++count;
	}
	return count;
}
ll gcd(ll a, ll b)
{
	if (b == 0)return a; else return gcd(b, a % b);
}
ll lcm(ll a, ll b)
{
	return(a / gcd(a, b)*b);
}
long double seq_pow_sum(ll n)
{
	return (0.1666666667)*n*(n + 1)*(2 * n + 1);
}
ll isPrime(ll n) {
	ll i; if (n == 2)return 1; if (n % 2 == 0)return 0;
	for (i = 3; i <= sqrt(n); i += 2)
		if (n%i == 0)return 0;
	return 1;
}
bool pow2(int i) {
	if (i <= 0) {
		return 0;
	}
	return (i & (i - 1));
}
bool islucky(string s)
{
	for (int i = 0; i < sz(s); i++)
		if (s[i] == '4' || s[i] == '7')
			continue;
		else
			return false;
	return true;
}
int main()
{
	fast();
	string s; cin >> s;
	set<string>v;
	deque<char>d;
	for (int i = 0; i < s.size(); i++)d.push_back(s[i]);
	int c = 1;
	for (int t = 0; t < s.size(); t++)
	{
		char ch = d[0];
		d.pop_front();
		d.push_back(ch);
		string c="";
		for (int f = 0; f < s.size(); f++)c += d[f];
		v.insert(c);
	}
	cout << v.size();
}

#include<iostream>
#include<cstring>
using namespace std;
char a[55][55];
int main()
{
	while(cin>>a[0])
	{
		int len=strlen(a[0]),cnt=0;
		for(int i=1;i<len;i++)
		{
			a[i][0]=a[i-1][len-1];
			for(int j=1;j<len;j++)
			  a[i][j]=a[i-1][j-1];
			a[i][len]='\0';
			for(int j=0;j<i;j++)
			  if(strcmp(a[j],a[i])==0)
			  {
			      cnt++;
			      break;
			  }
        }
		cout<<len-cnt<<endl;
	}
	return 0;
}

 #include<iostream>
 #include<string.h>
 #include<string>
 using namespace std;

 int main()
 {
     char s[51],a[51];
     int i,j,l,c,d=0,k=0;
     string B;

     cin>>s;
     B=s;
     l=strlen(s);
     for(j=0;j<l;j++){
     a[0]=s[l-1];
     for(i=1;i<l;i++){
        a[i]=s[i-1];
     }
     for(i=0;i<l;i++){
        s[i]=a[i];
     }
     if(B==s){
        break;
     }
    k++;
    }
    cout<<k+1<<endl;

 }

#include<stdio.h>
#include<string.h>
char s[200];
int main()
{  int len,i;
    while(~scanf("%s",s))
    {
        len=strlen(s);
        for( i=1; i<=len; i++)
        {
            if(len%i==0)
            {
                int ok=1;
                for(int j=i; j<len; j++)
                {
                    if(s[j]!=s[j%i])
                    {
                        ok=0;
                        break;
                    }
                }
                if(ok)
                {
                    printf("%d\n",i);
                    break;
                }
            }
        }
    }

}

/*
Lionel Messi is such a player that you may catch him, you may touch him, you may feel him
and definitely you may Love him.
Lionel Messi is Messi. A little Magician in this World .

*/

#include<bits/stdc++.h>

using namespace std;

#define fast ios_base::sync_with_stdio(false)
#define bfast cin.tie(0)
#define outs(x) cout << x << " "
#define outn(x) cout << x << "\n"
#define sf scanf
#define pf printf
#define nl puts("")
#define psb push_back

typedef long long LL;
typedef vector<int>vii;
typedef vector<LL>vll;

const int mod = 1000007;
const int high = 100;

int main()
{
	fast;
	string s , tmp , parmanent;
	int len , i , j , cnt=0;
	while(cin >> s)
	{
		cnt=1;

		parmanent = s;

		len = s.length();

		i = len-1;

		tmp = s[i];

		for(j=0; j<i; j++)
		{
			tmp+=s[j];
		}

		while(tmp != parmanent)
		{
			cnt+=1;

			s = tmp;

			len = s.length();

			i = len-1;

			tmp = s[i];

			for(j=0; j<i; j++)
			{
				tmp+=s[j];
			}
		}

		cout << cnt << "\n";
	}

	return 0;
}

#include<bits/stdc++.h>
using namespace std;
set<string>x;
int main()
{
 string a;
  cin>>a;
  x.insert(a);
  int l=a.size()-1;

  while(l--)

  {
  a.push_back(a[0]);

  a.erase(0,1);
//    cout<<a<<endl;
  x.insert(a);
  }
  cout<<x.size()<<endl;
}

#include<iostream>
#include<string>
#include<map>

using namespace std;

int main()
{
	string s;
	char c;
	int cnt = 0;
	map<string, int> m;
	cin >> s;
	for (int i = 0; i < s.size(); i++)
	{
		c = s[s.size() - 1];
		s =c+ s.substr(0, s.size() - 1);

		m[s]++;
		if (m[s] == 1)
			cnt++;

	}
	cout << cnt << endl;
//	system("pause");
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
    ll n,i,j;
    string s;
    cin>>s;
    vector<string>v;
    n=s.size();
    for(i=n-1;i>=0;i--)
    {
        s.push_back(s[0]);
        s.erase(0,1);
        v.push_back(s);
    }
    sort(v.begin(),v.end());
    v.erase(unique(v.begin(),v.end()),v.end());
    cout<<v.size()<<endl;
    return 0;
}

#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cmath>
#include <bits/stdc++.h>
using namespace std;
int n;
set<string>q;
string s;
int main()
{
	cin>>s;
	int n=s.size();
	for(int i=0;i<n;i++)
	{
		string t;
		for(int j=1;j<n;j++)
		{
			t+=s[(i+j)%n];
		}
		q.insert(t);
	}
	cout<<q.size();
	return 0;
}

#include <bits/stdc++.h>
using namespace std;

int main()
{
	string s;
	cin >> s;
	string a=s+s;
	cout << a.find(s, 1) << endl;
}

#include <iostream>
#include <cstring>
#include <string>

using namespace std;

int main(){
	char s[50];
	int i=0;
	cin>>s;
	char c[50],d[50];
	int b=strlen(s);
	strcpy(c,s);
	int n=0;
	for(i=0;i<b;i++){
		d[0]=s[b-1];
		d[1]='\0';
		n++;
		strncat(d,s,b-1);
		strcpy(s,d);
		if(strcmp(c,d)==0) break;
	}
	cout<<n<<endl;
}

#include<iostream>
#include<string>
#include<algorithm>
using namespace std;

int n,k;
string s,last,m[10000];

main(){
	cin>>s;

	for(int i=0; i<s.size(); i++){
		int l = s.size() - 1;
		last = s[l];
		s.erase(s.size() - 1,1);
		s.insert(0,last);

		m[i] = s;
	}

	sort(m,m+s.size());

	for(int i=0; i<s.size(); i++){
		if(m[i] != m[i + 1]) k++;
 	}

	cout<<k;
}

#include<bits/stdc++.h>

using namespace std;

int main() {
    string s;
    cin >> s;
    set<string> st;
    for (int i = 0; i < s.size(); i++){
        st.insert(s);
        s += s[0];
        s.erase(0,1);
    }
    cout << st.size();

    return 0;
}

#include<iostream>
#include<vector>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<cstdio>
#include<queue>
#include<map>
#include<climits>
#include<list>
#include<set>
using namespace std;

#define pb push_back
#define lli long long int
#define vc(x) vector<x>
#define rep(x, s, e) for(int x = s; x < e; x++)

#define si(x) scanf("%d", &x)
#define sii(x, y) scanf("%d %d", &x, &y)
#define siii(x, y, z) scanf("%d %d %d", &x, &y, &z)
#define siv(x, y, z, a) scanf("%d %d %d %d", &x, &y, &z, &a)

#define pi(x) printf("%d\n", x)
#define pii(x, y) printf("%d %d\n", x, y)
#define piii(x, y, z) printf("%d %d %d\n", x, y, z)
#define pkas(x) printf("Case %d:\n", x)
#define pkv(x, y) printf("Case %d: %d\n", x, y)

#define sc(x) cin>>x
#define scc(x, y) cin>>x>>y
#define sccc(x, y, z) cin>>x>>y>>z
#define scccc(x, y, z, a) cin>>x>>y>>z>>a

#define pr(x) cout<<x<<endl;

#define deb(x) cout << #x << ": " << x << endl;
#define debb(x, y) cout << #x << ": " << x << " " << #y << ": " << y << endl;
#define debbb(x, y, z) cout << #x << ": " << x << " " << #y << ": " << y << " " << #z << ": " << z << endl;
#define debbbb(x, y, z, a) cout << #x << ": " << x << " " << #y << ": " << y << " " << #z << ": " << z << " " << #a <<": "<< a <<endl;

#define setZ(x) memset(x,0,sizeof(x))
#define setInf(x) memset(x,63,sizeof(x))
#define setNInf(x) memset(x,-1,sizeof(x))

#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define MIN(a, b) ((a) < (b) ? (a) : (b))

// useful func
int chToIn(char a)
{
    int b;
    b = a-'0';
    return b;
}
int stToIn(string a)
{
    int b;
    b=atoi(a.c_str());
    return b;
}
string appendChar(string s,char a)
{
    s.append(1,a);
    return s;
}
//lli power(lli base,lli exp){if(!exp)return 1;--exp;while(exp>0){base*=base;--exp;}return base;

#define read(x) freopen(x, "r", stdin)
#define write(x) freopen(x, "w", stdout)

/*Defined Variables*/
#define MX 200005
#define inf INT_MAX
#define MOD 1000000007 // 10E9 + 7

lli bmod(lli a, lli b, lli c)
{
    if(b==0) return 1;
    if(b%2==0)
    {
        lli x=bmod(a,b/2,c);
        return (x*x)%c;
    }
    else return (a%c * bmod(a,b-1,c))%c;
}

set<string> st;

int main()
{
    string s, ns;
    cin>>s;
    int sz = s.size(), cnt;
    for(int i = 0; i < sz; i++)
    {
        ns = "";
        cnt = 0;
        for(int j = i;; j++)
        {
            if(j == sz)
            {
                j = 0;
            }
            ns += s[j];
            cnt++;
            if(cnt == sz)
            {
                st.insert(ns);
                break;
            }
        }
    }
    pr(st.size());
}

#include<bits/stdc++.h>
using namespace std;

int main()
{
	char str[52],temp[52];
    cin>>str;
    set<string> s;
    s.insert(str);
    int len=strlen(str);
    for(int i=0;i<len;i++)
    {
        temp[0]=str[len-1];

        for(int j=1;j<len;j++)
        {
            temp[j]=str[j-1];

        }
        for(int j=0;j<len;j++)
        {
        	str[j]=temp[j];
		}
		//cout<<str<<endl;
        s.insert(str);
    }
    cout<<s.size();
    return 0;
}

//freopen("input.txt","r",stdin);
//   freopen("output.txt","w",stdout);
#include <bits/stdc++.h>
using namespace std;
#define op                            \
    ios_base::sync_with_stdio(false); \
    cin.tie(0);                       \
    cout.tie(0)
#define pi 3.1415926536
int main()
{
    op;
    string s;
    set<string>ss;
    cin>>s;
    int n=s.size(),i,j;
    s=s+s;
    for(i=0;i<n;i++)
    {
        string b="";
            for(j=0;j<n;j++)
            {
                b+=s[i+j];
            }
        ss.insert(b);
    }
    cout<<ss.size()<<endl;
}

#include<bits/stdc++.h>
using namespace std;
int main(){
    string s1,s2;
    int i,l,j;
    set<string>s;
    cin>>s1;
    l=s1.size();
    for(i=0;i<l;i++){
        s2="";
        char temp=s1.at(l-1);
        s2+=temp;
        s2+=s1.substr(0,l-1);
        s.insert(s2);
        s1=s2;

    }
    cout<<s.size()<<endl;

}

#include <iostream>
#include <cstdio>
#include <set>
using namespace std;

string a;
set<string> v;
int main()
{
	int i;
	cin >> a;
	a += a;
	for (i = 0; i < a.size() / 2; i++) {
		v.insert(a.substr(i, a.size() / 2));
	}
    cout << v.size() << endl;
    return 0;
}

#include <iostream>
#include <algorithm>
#include <cmath>
using namespace std;

string a[100000 + 10];
string b[10000 + 10];
int main(){
	string s;
	cin >> s;
	a[0] = s;
	b[0] = s;
	int cnt = 0;
	for(int i=1; i<s.size(); i++){
		a[i] = a[i-1][s.size() - 1] ;
		a[i-1][s.size() - 1] = ' ';
		a[i] += a[i-1];
		bool flag = true;
		for(int j=0; j<s.size(); j++){
			b[i] += a[i][j];
		}
		for(int j=0; j<i; j++){
//			cout << b[i] << endl;
			if(b[i] == b[j]){
				flag = false;
				break;
			}
		}
		if(flag)
			cnt ++;
	}
//	for(int i=0; i<s.size(); i++){
//		cout << b[i] << endl;
//	}
	cout << cnt + 1;
	return 0;
}

#include<iostream>
#include<string>
#include<cmath>
#include<cctype>
#include<vector>
#include<sstream>
using namespace std;
int main(){
	string s;
	cin>>s;
	if(s.length()==1){
		cout<<1;
	}
	else{

	string a[50];
	a[0]=s;
	string c="";
	c=+s[s.length()-1];
	for(int i=0;i<s.length()-1;i++){
		c+=s[i];
	}
	a[1]=c;
	int a1=2;
	for(int i=0;i<s.length()-2;i++){
		string d="";
		d=+c[c.length()-1];
		for(int j=0;j<c.length()-1;j++){
			d+=c[j];
		}
		c=d;
		a[a1]=c;
		a1++;
	}
	string b[50];
	b[0]=a[0];
	int b1=1;
	for(int i=0;i<a1;i++){
		int g=0;
		for(int j=0;j<b1;j++){
			if(a[i]==b[j]){
				g++;
			}
		}
		if(g==0){
			b[b1]=a[i];
			b1++;
		}
	}
	cout<<b1;
}
	return 0;
}

#include<bits/stdc++.h>
int str(char *fin,char *arr,int l);
using namespace std;
int main()
{
	char arr[100];
	int i,cnt;
	scanf("%s",arr);
	int l=strlen(arr);
	int flag=0;
	for(i=1;i<l;i++)
	{
		if(arr[i]!=arr[i-1])
			flag=1;
	}
	char temp[100];
	char fin[100];
	fin[0]=arr[l-1];
	for(i=0;i<l-1;i++)
	{
		fin[i+1]=arr[i];
	}
	cnt=1;
	if(flag!=0)
	{
		while(str(fin,arr,l)!=0)
		{
			cnt++;
			for(i=0;i<l;i++)
			{
				temp[i]=fin[i];
			}
			fin[0]=temp[l-1];
			for(i=0;i<l-1;i++)
			{
				fin[i+1]=temp[i];
			}

		}
	}
	printf("%d\n",cnt);
	return 0;
}
int str(char *fin,char *arr,int l)
{
int i,flag=0;
for(i=0;i<l;i++)
{
if(arr[i]!=fin[i])
flag=1;
}
return flag;
}

#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<set>
#include<map>
#include<cmath>
#include<math.h>
#include<bitset>
#include<sstream>
#include <stdio.h>
#include <iomanip>
using namespace std;
//long long asd(long long x,long long y)
//{
//	long long i;
//	for(i=y;i<i+1;i++)
//	{
//		if(i%y==0&&i%x==0)
//			break;
//	}
//	return i;
//}
//int GCD(int a, int b)
//{
// if (a%b == 0) return b;
// else return GCD(b, a%b);
//}
//long long asd(int x,int y)
//{
//	if(y<=0)
//		return 1;
//	else
//		return x*asd(x-1,y-1);
//}
//long long asd2(int x)
//{
//	if(x<=1)
//		return 1;
//	else
//		return x*asd2(x-1);
//}
//vector<long long>asd;
//long long max(long long y)
//{
//	int v,i;
//	for(i=y;i>1;i--)
//	{
//		v=0;
//		for(int j=asd.size()-1;j>=0;j--)
//		{
//			if(asd[j]%i!=0)
//			{
//				v=1;
//				break;
//			}
//		}
//		if(v==0)
//			return i;
//	}
//	return 0;
//}

#define PI 3.14159265;
int asd2(int y)
{
	int z=0;
	while(y>1)
	{
		z++;
		y/=2;
	}
	return (z+1);
}
//string asd1(long long n,int x)
//{
//	string s="";
//	char c;
//	while(n!=0)
//	{
//		c=(n%x)+48;
//		s=c+s;
//		n=n/x;
//	}
//	return s;
//}
bool asd(int x)
{
	for(int i=2;i<=x/2;i++)
	{
		if(x%i==0)
			return false;
		return true;
	}
}
int main()
{
	string s,c;
	cin>>s;
	map<string,int>asd;
	for(int i=0;i<s.size();i++)
	{
		c=s[s.size()-1];
		s.erase(s.begin()+s.size()-1);
		c+=s;
		asd[c]++;
		s=c;
	}
	cout<<asd.size()<<endl;
	return 0;
}

#include <iostream>
#include <set>

using namespace std;

set<string> M;
string s;
char a[50];
char b[50];
int l;

int main()
{
    cin >> s;
    for (int i = 0; i < 51; i++)
    {
        if (s[i] == 0)
        {
            l = i;
            break;
        }
        a[i] = s[i];
    }

    for (int i = 0; i < l; i++)
    {
        for (int j = 1; j < l; j++)
            b[j] = a[j - 1];
        b[0] = a[l - 1];
        M.insert(b);
        for (int j = 0; j < l; j++) a[j] = b[j];
    }
    cout << M.size() << endl;
    return 0;
}

#include<stdio.h>
#include<string.h>

int main(){
	char A[55], B[55];
	bool beda=true;
	scanf("%s", A);

	int len=strlen(A), hasil=1;
	for(int i=len; i<=55; i++){
		B[i]='\0';
	}

	for(int i=1; i<len && beda==true; i++){
			B[0]=A[len-i];

			for(int j=1; j<len; j++){
				(j-i<0)? B[j]=A[j-i+len]:B[j]=A[j-i];
			}
			(strcmp(A,B)==0)? beda=false : hasil++;

	}

	printf("%d\n", hasil);

}

#include <iostream>
#include<algorithm>
#include<string>
#include<map>
#include<iomanip>
#include<vector>
#include<cmath>
#include<queue>
#include<stack>

#define mod 1000000007
#define pa(a,b) make_pair(a,b)
#define LL  long long int

LL maxx(LL a , LL b){ return a>b ?  a : b ;}
LL minn(LL a , LL b){ return a>b ?  b : a ;}

using namespace std;

int main()
{
    int ans ; string s;
    cin>>s; vector<string>a; a.push_back(s); ans=1;
    for(int i=0;i<s.size();i++)
    {
        s=s.substr(1,s.size()-1)+s[0]; bool flag=true;
        for(int j=0;j<a.size();j++)if(a[j]==s)flag=0;
        if(flag)a.push_back(s);
    }
    cout<<a.size();
}

#include <bits/stdc++.h>
#define fr first
#define r_0 return 0
#define sc scanf
#define pf printf
#define se second
#define ll long long
#define pb push_back
#define puf push_front
#define mk make_pair
#define ld long double
#define pr pair<int,int>
#define piip pair< pair<ll,ll>,ll >
#define fin(s) freopen( s, "r",stdin )
#define fout(s) freopen( s, "w", stdout )
#define TIME ios_base::sync_with_stdio(0)
using namespace std;
vector<int>V,B;
set<string>S;
queue<int>Q;
deque<int>D;
int n , x, a, b,c, cnt=1, ans,l ,r,m,d;
string s;
char arr[100][100];
int main ()
{
    TIME;
    cin>>s;
    for (int j=0; j <s.size(); j ++ )
    {

    for (int i =s.size()-2; i >=0; i -- )
        swap(s[i],s[i+1]);
            S.insert(s);
    }
    cout<<S.size();

}

#include <bits/stdc++.h>
#define per pair<int,int>

#define pb push_back
#define mp make_pair

using namespace std;
int len,ret;
bool ok = false;

inline void compara(char ss[],char s[])
{
    for (int i = 1; i<=len ; ++i)
        if (s[i]!=ss[i])
        {
            ok = true;
            return ;
        }
ok = false;

    return ;
}
int main()

{
#ifndef ONLINE_JUDGE
    freopen("in","r",stdin);
    freopen("out","w",stdout);
#endif // ONLINE_JUDGE
    char s[100][100], ss[105];
    ret = 1;
    gets(s[1]+1);
    len = strlen(s[1]+1);
    for (int i = 2; i<=len; ++i)
    {
        char ss[100];
        for (int j=1; j<=len; ++j)
            if (j!=len)ss[j+1] = s[i-1][j];
            else ss[1] = s[i-1][len];
        ok = false;
        for (int j = 1; j<i; ++j)
     {

                compara(s[j],ss);
                 if (ok==false)break;
    }
        if (ok==true) ++ ret;
        memcpy(s[i],ss,sizeof(ss));
    }
    printf("%d\n",ret );

    return 0;
}

#include<bits/stdc++.h>
#include<iostream>
#define ll long long
#define ull unsigned long long
#define ld long double
#define pb push_back
#define pf push_front
#define mp make_pair
#define all(v) v.begin(),v.end()
#define BP(n) __builtin_popcount(n)
#define bs(v,x) binary_search(all(v),x)
#define rep(i,n) for(i=0;i<n;i++)
#define rep1(j,n) for (j=i+1;j<n;j++)
#define Unique(v) vector<int>::iterator it; sort(all(v)); it= unique(all(v)); v.resize(distance(v.begin(),it))
#define mod 1000000007
#define PI acos(-1.0)
#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL)
using namespace std;
/*void input(vector<int>& v,int n){ int i,io; rep(i,n) { cin>>io; v.pb(io);} }
void output(vector<int> v) { int i; rep(i,v.size()) cout<<v.at(i)<<" "; }
map<char,int>  frequency(string v){ ll i; map<char,int> m; rep (i,v.length()) {  if (m.find(v[i])==m.end()) m.insert({v.at(i),1}); else m[v.at(i)]++; } return m; }
bool perfsq(ll n){ return (ceil(sqrt(n))==floor(sqrt(n))); }
bool ispower2(int n) { if (n&(n-1)==0) return true; else return false; }
bool binary_pred(int a,int b){ return a==b; }*/
int main() {
	fastio;
	//freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
	string a,test;
	cin>>a;
	int i,n = a.length();
	set<string> s;
	s.insert(a);
	rep(i,n) {
		test.pb(a[n-1]);
		test.append(a.substr(0,n-1));
		s.insert(test);
		a = test;
		test.clear();
	}
	cout<<s.size()<<endl;
}

#include <stdio.h>
#include <algorithm>
#include <cstring>
#include <cstdlib>
#include <cstdio>
#include <cmath>
#include <ctime>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
#include <sstream>
#if __cplusplus > 199711L
#include <unordered_set>
#include <unordered_map>
#include <tuple>
#endif

using namespace std;

#define mp make_pair
#define pb push_back
#define eb emplace_back
#define sqr(x) ((x) * (x))
#define sz(x) (int)(x.size())
#define all(x) x.begin(), x.end()
#define frp freopen("input.txt", "r", stdin); \
            freopen("output.txt", "w", stdout);

typedef long long ll;
typedef vector <int> vi;
typedef pair <ll, ll> pll;
typedef pair <int, int> pii;

const double eps = 1e-9;
const double pi = acos(-1.0);
const int maxn = (int)2e5 + 10;
const int inf = (int)1e9;
const int mod = (int)1e9 + 7;

int main(){ //frp
	string s;
	cin >> s;
	map <string, bool> ma;
	for (int i = 0;i < sz(s); i++){
		s = s.substr(sz(s) - 1, 1) + s.substr(0, sz(s) - 1);
		ma[s] = true;
	}
	printf("%d\n", sz(ma));

    return 0;
}

#include<cstdio>
#include<iostream>
#include<map>
using namespace std;
map<string,int>mp;
int main()
{
    string s;
    cin>>s;
    string a;
    int ans=0;
    a=s;
    for(int i=s.size()-1;i>=0;i--)
    {
        a[0]=s[s.size()-1];
        for(int j=1;j<s.size();j++)
        {
            a[j]=s[j-1];
        }
        s=a;
        if(mp[a]==0)
        {
            mp[a]=1;
            ans++;
        }
    }
    cout<<ans<<endl;
}

#include <cstdio>
#include <algorithm>
#include <iostream>
#include <math.h>
#include <vector>
#include <queue>
#include <cstring>
#include <map>
using namespace std;
#define maxn 55
char s[maxn][maxn];

int main()
{
	scanf("%s", s[0]);
	int n = strlen(s[0]);
	for (int i = 1; i < n; i++){
		for (int j = 0; j < n - 1; j++){
			s[i][j] = s[i - 1][j + 1];
		}
		s[i][n - 1] = s[i - 1][0];
	}
	int ans = 0;
	for (int i = 0; i < n; i++){
		int flag = 1;
		for (int j = 0; j < i; j++){
			if (strcmp(s[i], s[j]) == 0)
				flag = 0;
		}
		if (flag) ans++;
	}
	cout << ans << endl;

	return 0;
}

#include <algorithm>
#include <bitset>
#include <cassert>
#include <deque>
#include <queue>
#include <iomanip>
#include <iostream>
#include <iomanip>
#include <iterator>
#include <float.h>
#include <limits>
#include <list>
#include <map>
#include <numeric>
#include <math.h>
#include <set>
#include <sstream>
#include <stack>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <time.h>
#include <vector>

using namespace std;

typedef long long ll;
typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef vector<int> vi;
typedef vector<bool> vb;
typedef vector<ll> vl;
typedef vector<pi> vp;
typedef vector<string> vs;
typedef set<int> si;
typedef map<int, int> mi;
typedef multimap<int, int> mmi;

int main(int argc, char* argv[])
{
	ios::sync_with_stdio(false);

	string s;
	cin >> s;
	string curr = s;
	int res = 1;
	set<string> all;
	all.insert(s);
	for (int i = 0, size = s.length(); i < size - 1; ++i)
	{
		string next = curr[size - 1] + curr.substr(0, size - 1);
		if (!all.count(next))
		{
			++res;
			all.insert(next);
		}
		curr = next;
	}

	cout << res << endl;

	return 0;
}

#include<bits/stdc++.h>
#define ll long long int
using namespace std;
int main()
{
    string s;
    cin >> s;
    string a=s+s;
    cout << a.find(s,1) << endl;
}

#include <bits/stdc++.h>
#define r_0 return 0;
#define ll long long
#define ld  long double
#define pb push_back
#define fr first
#define se second
#define in freopen("input.txt","r",stdin);
#define out freopen("output.txt","w", stdout);
#define TIME ios_base::sync_with_stdio(NULL);
#define tcn cin.tie(NULL);
#define tct cout.tie(NULL);
using namespace std;
ld n , m , cnt , k, ans,mx,a,b, c, d, x, y;
string s,s1,s2;
set<string>se;
int main(){
    TIME tcn tct
     cin >> s;
     for( int i=0;i < s.size();i ++ ){
        for( int j=s.size()-2;j >=0;j -- ){
        swap(s[j],s[j+1]);
        }
       se.insert(s);
     }
     cout<<se.size();
}
/* MADE BY
//________________________________________________________
//________________________________________________________ //
                                                           //
// ██╗   ██╗     ██████╗     ███████╗    ██╗    ███╗   ██╗ //
// ╚██╗ ██╔╝    ██╔═══██╗    ██╔════╝    ██║    ████╗  ██║ //
//  ╚████╔╝     ██║   ██║    ███████╗    ██║    ██╔██╗ ██║ //
//   ╚██╔╝      ██║   ██║    ╚════██║    ██║    ██║╚██╗██║ //
//    ██║       ╚██████╔╝    ███████║    ██║    ██║ ╚████║ //
//    ╚═╝        ╚═════╝     ╚══════╝    ╚═╝    ╚═╝  ╚═══╝ //
//________________________________________________________ //
//________________________________________________________ */

#include<iostream>
using namespace std;
int main()
{
	string s,s1;
	cin>>s;
	s1=s;
	int flag=0;
	char ch=s1[s1.length()-1];
	for(int i=0;i<s.length();i++)
	{
		s1.insert(0,1,ch);
		//char ch2=s1[s1.length()-1];
		s1.erase(s.length(),1);
		ch=s1[s1.length()-1];
		if(s.compare(s1)!=0)
		{
			flag++;
			//cout<<s1<<endl;
		}
		else
		break;
	}
	cout<<flag+1;
}

#include <bits/stdc++.h>
using namespace std;
int main()
{
    set<string> s;
    string str;
    cin >> str;
    for (int i = 1; i <= str.size(); i++)
    {
        str += str[0];
        str.erase(str.begin());
        s.insert(str);
    }
    cout << s.size() << endl;
    return 0;
}

//Code submitted by Vivek
//Rule #0:If it works, don't touch it

#include<bits/stdc++.h>

using namespace std;

typedef long long int ll;
typedef long double ld;
typedef vector<long long int> vll;
typedef map<long long int,long long int> mll;
typedef pair<long long int,long long int> pll;
typedef vector<pair<long long int,long long int>> vpll;

#define fastread ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define lcm(x,y) (x*y)/(__gcd(x,y))
#define For(i,a,b) for(i=a;i<b;i++)
#define pb(x) push_back(x);
#define pf(x) push_front(x);
#define prt(s) cout<<s

int main()
{
    fastread;
    ll t,i,j,x,mod=1e9+7;
    string s,temp;
    cin>>s;
    temp=s;
    ll ans=1;
    ll n=s.size();
    while(1)
    {
        string temp2;
        temp2.pb(temp[n-1]);
        For(i,0,n-1) temp2.pb(temp[i]);
        temp=temp2;
        if(temp==s) break;
        else ans++;
    }
    prt(ans<<endl);
    return 0;
}

#include <bits/stdc++.h>
using namespace std;

#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define Max(x,y,z) max(x,max(y,z))
#define Min(x,y,z) min(x,min(y,z))
#define fr(i,s,e) for(i=s;i<e;i++)
#define rf(i,s,e) for(i=s-1;i>=e;i--)
#define pb push_back
#define mp make_pair

typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<long long, long long> pll;
typedef vector<int> vi;
typedef vector<long long> vll;
typedef vector<pair<long long,long long> > vpll;
typedef vector<vector<ll> > vvll;

#define PI 3.141592653589793
#define MOD 1000000007

int main()
{
    string s;
    cin>>s;
    ll n=s.size();
    vector<string> v(n);
    v[0]=s;
    for(ll i=1;i<n;i++)
    {
    	s=s[n-1]+s;
    	s.erase(s.begin()+n);
    	v[i]=s;
	}
	ll count=1;
	for(ll i=1;i<n;i++)
	{
		bool check=true;
		for(ll j=0;j<i;j++)
		{
			if(v[i]==v[j])
			{
				check=false;
				break;
			}
		}
		if(check)
		{
			count++;

		}
	}
	cout<<count;
	return 0;
}

#define _USE_MATH_DEFINES
#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<string>
#include<iostream>
#include<cctype>
#include<cstdio>
#include<vector>
#include<stack>
#include<queue>
#include <algorithm>
#include<math.h>
#include<set>
#include<map>
#include <sstream>
#include<iomanip>

//#include<bits/stdc++.h>

using namespace std;

int main() {

	string p;
	set<string>x;
	cin >> p;
	string a, b;
	b = p;
	x.insert(p);
	for (int i = 0; i < p.size(); i++) {
		a = a + p[i];
		b.erase(b.begin()+0);

		x.insert(b+a);

	}

	cout << x.size() << endl;
	return 0;
}

#include <iostream>
#include <string>
#include <vector>
#include <memory>
#include <math.h>

int compareInt(const void* a, const void* b) {
	int x = *(int*)a;
	int y = *(int*)b;
	if (x < y) {
		return -1;
	}
	if (x > y) {
		return 1;
	}
	return 0;
}

std::vector<int> getSimpleNumbers(const int n) {
	std::vector<int> result;
	int for_to = floor(sqrt((double)n));
	for (int i = 1; i <= for_to; i++) {
		if (n % i == 0) {
			result.push_back(i);
			result.push_back(n / i);
		}
	}
	return result;
}

std::vector<int> sortVector(std::vector<int> v) {
	std::shared_ptr<int> temp(new int[v.size()]);
	int i = 0;
	for (std::vector<int>::iterator it = v.begin(); it != v.end(); ++it) {
		temp.get()[i++] = *it;
	}
	std::qsort(temp.get(), i, sizeof(int), compareInt);
	std::vector<int> result;
	for (int j = 0; j < i; j++) {
		result.push_back(temp.get()[j]);
	}
	return result;
}

int main() {
	std::string s;
	std::cin >> s;
	int sizeS = s.length();
	std::vector<int> simple = sortVector(getSimpleNumbers(sizeS));
	//for (int i = 0; i < simple.size(); i++) {
	//	std::cout << simple[i] << " ";
	//}
	simple.pop_back();
	for (std::vector<int>::iterator it = simple.begin(); it != simple.end(); ++it) {
		bool resultIsGetted = true;
		for (int i = *it; i < sizeS; i++) {
			if (s[i] != s[i % *it]) {
				resultIsGetted = false;
				break;
			}
		}
		if (resultIsGetted) {
			std::cout << *it;
			return 0;
		}
	}
	std::cout << sizeS;
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
    string str;
    cin>>str;
    int n = str.size();
    set<string> a;
    for(int i = 0 ; i < n ; i++)
    {
        rotate(str.begin(),str.begin()+1,str.end());
        a.insert(str);
    }
    cout<<a.size()<<endl;
    return 0;
}

#include <bits/stdc++.h>

using namespace std;

int main(){
	string p, q;
	set<string> s;

	cin >> p;

	q = p;

	for(int i = p.size() - 1; i >= 0; i--){
		q = p[i] + q.substr(0, q.size() - 1);
		s.insert(q);
	}

	cout << s.size() << endl;

	return 0;
}

#include <bits/stdc++.h>
#define ll long long int
#define fl float
#define db double
#define ldb long double
#define PI 3,1415926535897
#define For(i,x,n) for(int i=x;i<=n;i++)
#define Forn(i,x,n) for(int i=n;i>=x;i--)
#define pb push_back
#define pob pop_back
#define MAX 1000007
#define MOD 1000000007
#define debug(a,vt,n) for(int i=vt;i<=n;i++){ cout << a[i] << " ";}
#define bg begin()
#define is(a) insert(a)
#define fall(x,a) for(x=a.bg;x!=a.end();x++)
#define _bum int main
#define  _You_cannot_answer_the_conversation return 0;
#define all(a) a.bg,a.end()
using namespace std;
bool isVowel(char x){
    if(x=='u' ||x=='e' ||x=='o' ||x=='a' ||x=='i'){
        return true;
    }
    else return false;
}
bool gcd(ll a, ll b){
    if(a%b==0) return b;
    else return gcd(b%a,a);
}

bool isPrime(ll n){
    for(int i=2;i<=sqrt(n);i++){
        if(n%i==0) return false;
    }
    return true;
}

ll Euclid(ll a, ll b, ll &x, ll &y) {
    if(b == 0) {
        x = 1;
        y = 0;
        return a;
    }
    ll x1, y1;
    ll gcd = Euclid(b, a%b, x1, y1);

    x = y1;
    y = x1 - (a / b) * y1;

    return gcd;
}

ll modInverse(ll b, ll m) { // ( b * x ) % m == 1
    ll x, y;
    ll g = Euclid(b,m,x,y);
    if(g != 1)
        return -1;  // no solution
    return (x%m + m) % m;
}

ll modDivice(ll a, ll b, ll m) { // (b * c) % m = a % m.
    a %= m;
    ll inv = modInverse(b,m);
    if(inv == -1)
        return -1;
    return (inv * a) % m;

}

ll pow(ll a, ll n) {
    if(n == 0)
        return 1;
    if(n == 1)
        return a;
    ll t = pow(a,n/2);
    t *= t;
    if(n%2)
        t = t * a;

    return t;
}

ll powMod(ll a, ll n, ll m) {
    if(n == 0)
        return 1%m;
    if(n == 1)
        return a%m;
    ll t = powMod(a,n/2,m) % m;
    t = (t * t) % m;

    if(n % 2)
        t = (t * a) % m;

    return t%m;
}

ll powMod2(ll a, ll n, ll m) {
    ll res = 1;
    for(ll i = n ; i ; i >>= 1) {
        if(i & 1)
            res = (res * a) % m;
        a = (a * a) % m;
    }
    return res;
}

ll phiEuler(ll n) {
    ll res = n;

    for(ll i = 2 ; i * i <= n ; i++) {
        if(n%i == 0) {
            while(n % i == 0)
                n /= i;
            res -= (res / i);
        }
    }

    if(n != 1)
        res -= (res / n);
    return res;

}

void BornPhi(ll n) {
    ll phi[n+1];

    for(ll i = 1 ; i <= n; i++) {
        phi[i] = i;
    }

    for(ll p = 2 ; p <= n ; p++) {
        if(phi[p] == p) {
            phi[p] = p - 1;

            for(ll i = 2*p ; i <= n ; i += p) {
                phi[i] = (phi[i]/p) * (p-1);
            }
        }
    }
}

ldb C(ll n, ll k) {
    long double res = 1;
    if(k > n - k)
        k = n - k;

    for(ll i = 0 ; i < k ; i++) {
        res *= (n - i);
        res /= (i+1);
    }
    return res;
}

bool isPara(string s){
    for(int i=0;i<s.length();i++){
        if(s[i]!=s[s.length()-1-i]) return false;
    }
    return true;
}
string s;
set<string> a;

_bum(){
    cin >> s;
    a.is(s);
    ll tmp =s.length()-1;
    while(tmp-->0){
       char x=s[s.length()-1];
       s.erase(s.length()-1,1);
       s=x+s;
       a.is(s);
    }
    cout << a.size();

    _You_cannot_answer_the_conversation
}

#include <iostream>
#include <algorithm>
#include <cctype>
#include <string.h>
#include <string>
#include <sstream>
#include <math.h>
#include <set>

using namespace std;

int main ()
{
    string s1;
    cin>>s1;

    set <string> str;
    str.insert(s1);
    for(int j=1 ; j<=s1.length() ; j++)
    {
        string s2 = "";
        for(int i=0 ; i<s1.length()-1 ; i++)
        {
            s2 += s1[i];
        }
        s2 = s1[s1.length()-1] + s2;
        str.insert(s2);
        s1 = s2;
    }

    cout<<str.size();

}

#include <iostream>
#include <set>
#include <string>

void answer(size_t v)
{
    std::cout << v << '\n';
}

void solve(std::string& s)
{
    const size_t n = s.length();

    std::set<std::string> words;
    for (size_t i = 0; i < n; ++i)
        words.insert(s.substr(i+1) + s.substr(0, i+1));

    answer(words.size());
}

int main()
{
    std::string s;
    std::cin >> s;

    solve(s);

    return 0;
}

#include<bits/stdc++.h>
#define r_0 return 0
#define pb push_back
#define ll long long
#define fr first
#define se second
using namespace std;
ll m, cnt, mx, n , x , h, sum , y, ans,z,res, q, l, o, n1, g,mn,c, i,mxx;
pair< int, int>p[1001];
string s,s1,s2;
vector<string>v,v1,v2;
set<string>st;
set<int> it;
deque<int>d,d1,d2;
char a, b;
map<string , int>mp;

int main()
{
   cin >> s;
   v.pb ( s );
   m = s.size();
   s2 = s;
   cnt = 1;
   for ( int i = 0; i < m; i ++ )
   {
        s1 += s[m - cnt];
        for ( int j = 0; j < m - 1; j ++ )
        {
            s1 += s[j];
        }
        v.pb( s1 );
        s = s1;
        s1.clear();
        cnt = 1;
   }
   for ( int i = 0; i < v.size(); i ++ )
          st.insert( v[i] );
          cout << st.size();
}

#include <iostream>
#include <string>
#include <math.h>
#include <stdio.h>

using namespace std;

char buffer[200];
char last[50][200];
int c = 0;

int main()
{
  gets(buffer);
  int len = strlen(buffer);
  strcpy(last[0], buffer);
  c = 1;
  for (int i = 1; i < len; ++i)
  {
    char ch = buffer[0];
    strcpy(&buffer[0], &buffer[1]);
    buffer[len-1] = ch;
    buffer[len] = 0;
    bool f = false;
    for (int j = 0; j < c; ++j)
    {
      if (memcmp(buffer, last[j], len) == 0)
      {
        f = true;
        break;
      }
    }
    if (!f)
    {
      strcpy(last[c], buffer);
      ++c;
    }
  }
  printf("%d\n", c);

  return 0;
}

#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <set>
#include <queue>
#include <string>
using namespace std;
char s[105];
string ss[105];
int main()
{
    while(scanf("%s",s)!=EOF){
        int n=strlen(s);
        ss[0]=s;
        for(int i=1;i<n;i++){
            char c=s[n-1];
            for(int j=n-1;j>0;j--){
                s[j]=s[j-1];
            }
            s[0]=c;
            ss[i]=s;
        }
        sort(ss,ss+n);
        int ans=0;
        for(int i=0;i<n;i++){
            while(ss[i]==ss[i+1]){
                i++;
                if(i==n) break;
            }
            ans++;
        }
        cout<<ans<<endl;

    }

    return 0;
}

#include<stdio.h>
#include <iostream>
#include<string.h>
using namespace std;

int main() {
	char a[51],b[51];
	cin>>a;//cout<<a;
	int l=strlen(a);
	int x=1;
	int k;
	for(int i=1;i<l;i++)
	{
		if(a[i]==a[0])
		{
			for(int j=0;j<l;j++)
			{
				k=(j+i)%l;
				//cout<<k<<" ";
				b[j]=a[k];

			}b[l]='\0';

			if(!strcmp(a,b))break;
		}x++;
	}
	cout<<x;
	return 0;
}

#include <stdexcept>
#include <iostream>
#include <iomanip>
#include <sstream>
#include <fstream>
#include <cassert>
#include <cstring>
#include <cstdarg>
#include <cstdio>
#include <memory>
#include <random>
#include <cmath>
#include <ctime>
#include <functional>
#include <algorithm>
#include <complex>
#include <numeric>
#include <limits>
#include <bitset>
#include <vector>
#include <string>
#include <queue>
#include <deque>
#include <array>
#include <list>
#include <map>
#include <set>

using namespace std;

#define all(a) (a).begin(), (a).end()
#define sz(a) static_cast<int>((a).size())
#define FOR(i, a, b) for (int i(a), b_(b); i < b_; ++i)
#define REP(i, n) FOR (i, 0, n)
#define FORD(i, a, b) for (int i(a), b_(b); i >= b_; --i)
#define UNIQUE(a) sort(all(a)), (a).erase(unique(all(a)), (a).end())
#define CL(a, v) memset(a, v, sizeof a)
#define eb emplace_back
#define pb push_back
#define X first
#define Y second

typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef pair<int, int> pii;
template <class T> using min_queue = priority_queue<T, vector<T>, greater<T>>;

const int INF = static_cast<int>(1e9);
const long long INF_LL = static_cast<long long>(4e18);
const double pi = acos(-1.0);

template <class T> inline T& smin(T& x, const T& y) { return x > y ? x = y : x; }
template <class T> inline T& smax(T& x, const T& y) { return x < y ? x = y : x; }
template <class T> inline T sqr(const T& x) { return x * x; }
template <class T> inline int sgn(const T& x) { return (T(0) < x) - (x < T(0)); }

template <class T> T gcd(T a, T b) {
  for (a = abs(a), b = abs(b); a && b; a >= b ? a %= b : b %= a);
  return a + b;
}

using uint = unsigned int;
// Buffer size should be 2^12 or 2^13 for optimal performance with files.
const uint BUFFER_SIZE = 1 << 12;
// Maximum possible length of a string representing primitive type
// assuming we won't encounter huge double values.
const uint MAX_LENGTH = 1 << 7;

namespace Detail {
  struct Width { uint value; };
  struct Fill { char value; };
  struct Base { uint value; };
  struct Precision { uint value; };
  struct Delimiter { const char* value; };
}  // namespace Detail

Detail::Width setWidth(uint value = 0) { return {value}; }
Detail::Fill setFill(char value = ' ') { return {value}; }
Detail::Base setBase(uint value = 10) { assert(2 <= value && value <= 36); return {value}; }
Detail::Precision setPrecision(uint value = 9) { assert(value < MAX_LENGTH); return {value}; }
Detail::Delimiter setDelimiter(const char* value = " ") { return {value}; }

/*************************************************** input classes ****************************************************/
class InputDevice {
protected:
  const char* head;
  const char* tail;

  InputDevice(const char* head, const char* tail) : head(head), tail(tail), base(setBase().value) {}
  InputDevice(InputDevice const&) = delete;
  InputDevice& operator = (InputDevice const&) = delete;

  virtual void fillInput() = 0;

  inline char nextChar() {
    if (__builtin_expect(head >= tail, false)) fillInput();
    return *head++;
  }

  template <class I> int readUnsignedIntGeneral(I& arg, char c) {
    I value = 0;
    int length = 0;
    for (;; ++length, c = nextChar()) {
      if (isDigit(c)) c -= '0';
      else if (isUpper(c)) c -= 'A' - 10;
      else if (isLower(c)) c -= 'a' - 10;
      else c = base;
      if (c >= base) break;
      value = base * value + c;
    }
    arg = value;
    return --head, length;
  }

  template <class I> inline int readUnsignedInt(I& arg, char c) {
    if (__builtin_expect(base > 10, false)) return readUnsignedIntGeneral(arg, c);
    I value = 0;
    int length = 0;
    for (; static_cast<unsigned char>(c - '0') < base; ++length, c = nextChar())
      value = base * value + c - '0';
    arg = value;
    return --head, length;
  }

  template <class I> inline bool readSignedInt(I& arg, char c) {
    bool negative = c == '-';
    if (negative) c = nextChar();
    typename make_unsigned<I>::type unsignedArg;
    if (readUnsignedInt(unsignedArg, c) == 0) return false;
    arg = negative ? ~static_cast<I>(unsignedArg - 1) : static_cast<I>(unsignedArg);
    return true;
  }

  template <class F> bool readFloatingPoint(F& arg, char c) {
    bool negative = c == '-';
    if (negative) c = nextChar();
    unsigned long long integerPart;
    if (readUnsignedInt(integerPart, c) == 0) return false;
    arg = static_cast<F>(integerPart);
    if (nextChar() == '.') {
      unsigned long long fractionalPart = 0;
      int fractionalLength = readUnsignedInt(fractionalPart, nextChar());
      if (fractionalLength > 0) {
        unsigned long long basePower = 1;
        for (; fractionalLength; --fractionalLength) basePower *= base;
        arg += static_cast<F>(fractionalPart) / basePower;
      }
    } else --head;
    if (negative) arg = -arg;
    return true;
  }

public:
  static inline bool isSpace(char c) { return static_cast<unsigned char>(c - '\t') < 5 || c == ' '; }
  static inline bool isDigit(char c) { return static_cast<unsigned char>(c - '0') < 10; }
  static inline bool isUpper(char c) { return static_cast<unsigned char>(c - 'A') < 26; }
  static inline bool isLower(char c) { return static_cast<unsigned char>(c - 'a') < 26; }
  static inline bool isOneOf(char c, const char* str) { return strchr(str, c) != nullptr; }

  uint base;
  void putBack() { --head; }  // can be called only once directly after successfully reading a character

  inline bool readChar(char& arg) {
    if (__builtin_expect(head >= tail, false)) {
      fillInput();
      if (__builtin_expect(head >= tail, false)) return arg = '\0', false;
    }
    return arg = *head++, true;
  }

  template <class UnaryPredicate>
  inline char skipCharacters(UnaryPredicate isSkipped) {
    char c;
    do { c = nextChar(); } while (isSkipped(c));
    return c;
  }
  inline char skipCharacters() { return skipCharacters(isSpace); }

  template <class UnaryPredicate>
  inline bool readString(char* arg, int limit, UnaryPredicate isTerminator) {
    skipCharacters(isTerminator);
    // put back first non-skipped character, reserve space for null character
    for (--head, --limit; head < tail; fillInput()) {
      ptrdiff_t chunkSize = find_if(head, min(tail, head + limit), isTerminator) - head;
      arg = copy_n(head, chunkSize, arg);
      head += chunkSize;
      limit -= chunkSize;
      if (chunkSize == 0 || head < tail) break;
    }
    return *arg = '\0', true;
  }

  template <class I> inline bool readUnsignedInt(I& arg) { return readUnsignedInt(arg, skipCharacters()) > 0; }
  template <class I> inline bool readSignedInt(I& arg) { return readSignedInt(arg, skipCharacters()); }
  template <class F> inline bool readFloatingPoint(F& arg) { return readFloatingPoint(arg, skipCharacters()); }
};

class InputFile : public InputDevice {
  FILE* file;
  bool lineBuffered;
  bool owner;
  char buffer[BUFFER_SIZE];

  void fillInput() override {
    head = buffer;
    *buffer = '\0';
    if (__builtin_expect(!lineBuffered, true)) {
      tail = head + fread(buffer, 1, BUFFER_SIZE, file);
    } else {
      tail = head;
      if (fgets(buffer, BUFFER_SIZE, file)) while (*tail) ++tail;
    }
  }

public:
  InputFile(FILE* file = stdin, bool lineBuffered = true, bool takeOwnership = false)
  : InputDevice(buffer, buffer) , file(file), lineBuffered(lineBuffered), owner(takeOwnership) {}
  InputFile(const char* fileName) : InputFile(fopen(fileName, "r"), false, true) {}
  ~InputFile() { if (owner) fclose(file); }
};

// Picks up data appended to the string but doesn't handle reallocation.
class InputString : public InputDevice {
  void fillInput() override { while (*tail) ++tail; }

public:
  InputString(const string& s) : InputDevice(s.data(), s.data() + s.size()) {}
  InputString(const char* s) : InputDevice(s, s + strlen(s)) {}
};

/*************************************************** output classes ***************************************************/
class OutputDevice {
protected:
  char buffer[BUFFER_SIZE + MAX_LENGTH];
  char* output;
  char* end;
  bool separate;

  OutputDevice() : output(buffer), end(buffer + BUFFER_SIZE + MAX_LENGTH), separate(false), width(setWidth().value)
  , fill(setFill().value), base(setBase().value), precision(setPrecision().value), delimiter(setDelimiter().value) {}
  OutputDevice(OutputDevice const&) = delete;
  OutputDevice& operator = (OutputDevice const&) = delete;

  virtual void writeToDevice(uint count) = 0;

  inline void flushMaybe() {
    if (__builtin_expect(output >= buffer + BUFFER_SIZE, false)) {
      writeToDevice(BUFFER_SIZE);
      output = copy(buffer + BUFFER_SIZE, output, buffer);
    }
  }

  template <class I> inline char* writeUnsignedInt(I arg, char* last) {
    if (__builtin_expect(arg == 0, false)) *--last = '0';
    if (__builtin_expect(base == 10, true)) {
      for (; arg; arg /= 10) *--last = '0' + arg % 10;
    } else for (; arg; arg /= base) {
      I digit = arg % base;
      *--last = digit < 10 ? '0' + digit : 'A' - 10 + digit;
    }
    return last;
  }

  template <class I> inline char* writeSignedInt(I arg, char* last) {
    auto unsignedArg = static_cast<typename make_unsigned<I>::type>(arg);
    if (arg < 0) {
      last = writeUnsignedInt(~unsignedArg + 1, last);
      *--last = '-';
      return last;
    }
    return writeUnsignedInt(unsignedArg, last);
  }

  template <class F> char* writeFloatingPoint(F arg, char* last) {
    bool negative = signbit(arg);
    if (negative) arg = -arg;
    if (isnan(arg)) for (int i = 0; i < 3; ++i) *--last = i["NaN"];
    else if (isinf(arg)) for (int i = 0; i < 3; ++i) *--last = i["fnI"];
    else {
      auto integerPart = static_cast<unsigned long long>(arg);
      arg -= integerPart;
      for (int i = 0; i < precision; ++i) arg *= base;
      auto fractionalPart = static_cast<unsigned long long>(arg);
      if ((arg - fractionalPart) * 2 >= static_cast<F>(1)) {
        if (precision == 0) ++integerPart;
        else ++fractionalPart;
      }
      if (precision > 0) {
        char* point = last - precision;
        last = writeUnsignedInt(fractionalPart, last);
        ::fill(point, last, '0');
        last = point;
        *--last = '.';
      }
      last = writeUnsignedInt(integerPart, last);
    }
    if (negative) *--last = '-';
    return last;
  }

  inline int writeT(char* first) {
    int delimiterLenght = separate ? writeDelimiter() : 0;
    separate = true;
    int charsWritten = static_cast<int>(end - first);
    if (__builtin_expect(charsWritten < width, false))
      charsWritten += writeFill(width - charsWritten);
    output = copy(first, end, output);
    flushMaybe();
    return delimiterLenght + charsWritten;
  }

  inline int writeFill(int count) {
    int result = count;
    if (__builtin_expect(output + count + MAX_LENGTH < end, true)) {
      if (count == 1) *output++ = fill;
      else output = fill_n(output, count, fill);
    } else for (uint chunkSize = static_cast<uint>(buffer + BUFFER_SIZE - output);; chunkSize = BUFFER_SIZE) {
      if (chunkSize > count) chunkSize = count;
      output = fill_n(output, chunkSize, fill);
      flushMaybe();
      if ((count -= chunkSize) == 0) break;
    }
    return result;
  }

public:
  int width;
  char fill;
  uint base;
  uint precision;
  string delimiter;

  inline int writeChar(char arg) { separate = false; *output++ = arg; flushMaybe(); return 1; }

  inline int writeString(const char* arg, int count, bool checkWidth = true) {
    separate = false;
    int result = count + (checkWidth && count < width ? writeFill(width - count) : 0);
    if (__builtin_expect(output + count + MAX_LENGTH < end, true)) {
      if (count == 1) *output++ = *arg;
      else output = copy_n(arg, count, output);
    } else for (int chunkSize = static_cast<int>(buffer + BUFFER_SIZE - output);; chunkSize = BUFFER_SIZE) {
      if (chunkSize > count) chunkSize = count;
      output = copy_n(arg, chunkSize, output);
      flushMaybe();
      if ((count -= chunkSize) == 0) break;
      arg += chunkSize;
    }
    return result;
  }

  inline int writeDelimiter() { return writeString(delimiter.c_str(), static_cast<int>(delimiter.size()), false); }

  template <class I> inline int writeUnsignedInt(I arg) { return writeT(writeUnsignedInt(arg, end)); }
  template <class I> inline int writeSignedInt(I arg) { return writeT(writeSignedInt(arg, end)); }
  template <class F> inline int writeFloatingPoint(F arg) { return writeT(writeFloatingPoint(arg, end)); }

  inline void flush() {
    writeToDevice(static_cast<uint>(output - buffer));
    output = buffer;
  }
  virtual ~OutputDevice() {};
};

class OutputFile : public OutputDevice {
  FILE* file;
  bool owner;

  void writeToDevice(uint count) override {
    fwrite(buffer, 1, count, file);
    fflush(file);
  }

public:
  OutputFile(FILE* file = stdout, bool takeOwnership = false) : file(file), owner(takeOwnership) {}
  OutputFile(const char* fileName) : OutputFile(fopen(fileName, "w"), true) {}
  ~OutputFile() override { flush(); if (owner) fclose(file); }
};

class OutputString : public OutputDevice {
  string& str;

  void writeToDevice(uint count) override { str.append(buffer, count); }

public:
  OutputString(string& str) : OutputDevice(), str(str) {}
  ~OutputString() override { flush(); }
};

/**************************************************** read & write ****************************************************/
//unique_ptr<InputDevice> input;
unique_ptr<InputFile> input;
//unique_ptr<OutputDevice> output;
unique_ptr<OutputFile> output;

// property setters
inline int read(Detail::Base base) { input->base = base.value; return 0; }
// primitive types
inline int read() { return 0; }
inline int read(char& arg) { return input->readChar(arg); }
template <class I> inline typename enable_if<is_integral<I>::value && is_unsigned<I>::value,
int>::type read(I& arg) { return input->readUnsignedInt(arg); }
template <class I> inline typename enable_if<is_integral<I>::value && is_signed<I>::value,
int>::type read(I& arg) { return input->readSignedInt(arg); }
template <class F> inline typename enable_if<is_floating_point<F>::value,
int>::type read(F& arg) { return input->readFloatingPoint(arg); }
// characters skip
inline int read(const char& arg) { input->skipCharacters([arg](char c) { return arg != c; }); return 0; }
inline int read(const char* arg) {
  if (*arg) input->skipCharacters([arg](char c) { return InputDevice::isOneOf(c, arg); });
  else input->skipCharacters();
  input->putBack(); return 0;
}
inline int read(bool (*isSkipped)(char)) { input->skipCharacters(isSkipped); input->putBack(); return 0; }
// forward declarations so everything compiles
template <class... Ts> int read(char* arg, int limit, bool (*isTerminator)(char), Ts&&... args);
template <class... Ts> int read(char* arg, int limit, const char* terminators, Ts&&... args);
template <class Iterator, class... Ts, typename = decltype(*std::declval<Iterator>())>
int read(Iterator first, Iterator last, Ts&&... args);
template <class Iterator, class... Ts, typename = decltype(*std::declval<Iterator>())>
int read(Iterator first, int count, Ts&&... args);
template <class T, class... Ts, typename = typename enable_if<!is_convertible<T, char*>::value, void>::type>
int read(T&& arg1, Ts&&... args);
// C strings
inline int read(char* arg, int limit, const char* terminators = "") {
  if (!*terminators) return input->readString(arg, limit, InputDevice::isSpace);
  else return input->readString(arg, limit, [terminators](char c) { return InputDevice::isOneOf(c, terminators); });
}
template <class... Ts>
inline int read(char* first, char* last, Ts&&... args) {
  return read(first, static_cast<int>(last - first), forward<Ts>(args)...);
}
template <int N, class... Ts>
inline int read(char (&arg)[N], Ts&&... args) { return read(static_cast<char*>(arg), N, forward<Ts>(args)...); }
template <class... Ts>
inline int read(char* arg, int limit, bool (*isTerminator)(char), Ts&&... args) {
  int argsRead = input->readString(arg, limit, isTerminator);
  return argsRead + read(forward<Ts>(args)...);
}
template <class... Ts>
inline int read(char* arg, int limit, const char* terminators, Ts&&... args) {
  int argsRead = read(arg, limit, terminators);
  return argsRead + read(forward<Ts>(args)...);
}
// complex types and ranges
template <class T1, class T2>
inline int read(pair<T1, T2>& arg) { return read(arg.first) == 1 && read(arg.second) == 1 ? 1 : 0; }
template <class T>
inline int read(vector<T>& arg) {
  uint n;
  if (read(n) == 0) return 0;
  arg.resize(n);
  return read(arg.begin(), arg.end());
}
template <class Iterator, class... Ts, typename>
int read(Iterator first, Iterator last, Ts&&... args) {
  int success = 1;
  for (; first != last; ++first) success &= read(*first);
  return success + read(forward<Ts>(args)...);
}
template <class Iterator, class... Ts, typename>
int read(Iterator first, int count, Ts&&... args) { return read(first, first + count, forward<Ts>(args)...); }
template <class T, class... Ts, typename>
inline int read(T&& arg1, Ts&&... args) {
  int argsRead = read(forward<T>(arg1));
  return argsRead + read(forward<Ts>(args)...);
}

// property setters
inline int write(Detail::Width width) { output->width = static_cast<int>(width.value); return 0; }
inline int write(Detail::Fill fill) { output->fill = fill.value; return 0; }
inline int write(Detail::Base base) { output->base = base.value; return 0; }
inline int write(Detail::Precision precision) { output->precision = precision.value; return 0; }
inline int write(Detail::Delimiter delimiter) { output->delimiter = delimiter.value; return 0; }
// primitive types
inline int write() { return 0; }
inline int write(char arg) { return output->writeChar(arg); }
template <class I> inline typename enable_if<is_integral<I>::value && is_unsigned<I>::value,
int>::type write(I arg) { return output->writeUnsignedInt(arg); }
template <class I> inline typename enable_if<is_integral<I>::value && is_signed<I>::value,
int>::type write(I arg) { return output->writeSignedInt(arg); }
template <class F> inline typename enable_if<is_floating_point<F>::value,
int>::type write(F arg) { return output->writeFloatingPoint(arg); }
// complex types
inline int write(const char* arg) { return output->writeString(arg, static_cast<int>(strlen(arg))); }
template <int N>
inline int write(char (&arg)[N]) { return output->writeString(arg, static_cast<int>(strlen(arg))); }
inline int write(const string& arg) { return output->writeString(arg.c_str(), static_cast<int>(arg.size())); }
template <class T1, class T2>
inline int write(const pair<T1, T2>& arg) {
  int charsWritten = write(arg.first);
  charsWritten += output->writeDelimiter();
  return charsWritten + write(arg.second);
}
// forward declarations so everything compiles
template <class Iterator, class... Ts,
typename = typename enable_if<!is_convertible<Iterator, const char*>::value, decltype(*std::declval<Iterator>())>::type>
int write(Iterator first, Iterator last, Ts&&... args);
template <class Iterator, class... Ts,
typename = typename enable_if<!is_convertible<Iterator, const char*>::value, decltype(*std::declval<Iterator>())>::type>
int write(Iterator first, int count, Ts&&... args);
template <class T, class T2, class... Ts> int write(T&& arg, T2&& arg2, Ts&&... args);
// ranges
template <class Iterator, class... Ts, typename>
int write(Iterator first, Iterator last, Ts&&... args) {
  int charsWritten = 0;
  for (; first != last; charsWritten += ++first == last ? 0 : output->writeDelimiter()) charsWritten += write(*first);
  return charsWritten + write(forward<Ts>(args)...);
}
template <class Iterator, class... Ts, typename>
int write(Iterator first, int count, Ts&&... args) { return write(first, first + count, forward<Ts>(args)...); }
template <class T, class T2, class... Ts>
inline int write(T&& arg, T2&& arg2, Ts&&... args) {
  int charsWritten = write(forward<T>(arg));
  return charsWritten + write(forward<T2>(arg2), forward<Ts>(args)...);
}
template <class... Ts>
inline int writeln(Ts&&... args) { return write(forward<Ts>(args)..., '\n'); }

void flush() { output->flush(); }

template <class C, int N>
class KMP {
public:
  const C* pattern;
  int n, prefixF[N+1] = {-1, 0};  // Canonically prefixF[0] = 0, but I use -1.

  void build(const C* s, int length) {
    pattern = s;
    n = length;
    for (int i = 1; i < n; ++i) {
      int j = prefixF[i];
      while (j >= 0 && pattern[i] != pattern[j]) j = prefixF[j];
      prefixF[i + 1] = j + 1;
    }
  }
};

const int N = 33;
char s[N];
KMP<char, N> kmp;

int main() {
#ifdef LocalHost
  //input.reset(new InputFile("input.txt"));
  input.reset(new InputFile());
  output.reset(new OutputFile());
  //output.reset(new OutputFile("output2.txt"));
#else
  input.reset(new InputFile(stdin, false));
  //input.reset(new InputFile());
  output.reset(new OutputFile());
#endif

  read(s);
  int n = strlen(s);
  kmp.build(s, n);
  int m = 0;
  for (int p = n; p > 0; p = kmp.prefixF[p])
    if (p != n && n % p == 0) {
      m = p;
      break;
    }
  writeln(n - m);

#ifdef LocalHost
  flush();
  cerr << endl << endl << static_cast<double>(clock()) / CLOCKS_PER_SEC << endl;
#endif
  return 0;
}

#include<bits/stdc++.h>
#define eps 1e-8
#define ll long long
#define ed cout<<endl
#define pb push_back
#define pf push_front
#define mp make_pair
#define fi first
#define ll long long
#define se second
#define inf 2e9
#define sz 456789
#define all(x) x.begin(), x.end()
#define pi 3.14159265359
using namespace std;

void faster(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
}
ll q, n, m;
string s;
char c;
int main(){

    faster();
    cin >> s;
    for(int i = 1; i < s.size(); i++){
        if(s[0] == s[i]){
            cout << i + 1;
            return 0;
        }
    }
    cout << s.size();
    return 0;
}

#include<bits/stdc++.h>
#define ll long long int
using namespace std;
int main()
{
    ll n,i,c=0;
    string s;
    cin>>s;
    n=s.size();
    sort(s.begin(),s.end());
    for(i=0;i<n-1;i++){
        if(s[i]!=s[i+1])
            c++;
    }
    cout<<c+1<<endl;
}

#include<bits/stdc++.h>
#define eps 1e-8
#define ll long long
#define ed cout<<endl
#define pb push_back
#define pf push_front
#define mp make_pair
#define fi first
#define ll long long
#define se second
#define inf 2e9
#define sz 456789
#define all(x) x.begin(), x.end()
#define pi 3.14159265359
using namespace std;

void faster(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
}
ll q, n, m;
string s;
set<char> ss;
int main(){

    faster();
    cin >> s;
    for(int i = 0; i < s.size(); i++){
        ss.insert(s[i]);
    }
    cout << ss.size();
    return 0;
}

/*input
yzyz
*/
/*For who wanna hack my code http://ideone.com/ZTEvP7*/
#define el '\n'
#include<bits/stdc++.h>
using namespace std;
char a[50],b[50][50];
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cin>>a;
    int i,n=strlen(a),j,k=0,t,cnt;
    for(i=0;i<n;i++)
    {
    	k=0;
    	for(j=0;j<n;j++)
    	{
    		t=i+k;
    		if(t>=n) t-=n;
    		b[i][j]=a[t];
    		k++;
    	}
    }
    cnt=n;
    for(i=0;i<n;i++)
    {
    	/*cout<<b[i]<<el;*/
    	for(j=i+1;j<n;j++)
    	{
    		if(strcmp(b[i],b[j])==0) cnt--;
    	}
    }
    cout<<cnt;
}

#include<bits/stdc++.h>
using namespace std;
main(){
	#ifndef ONLINE_JUDGE
	freopen("in.txt","r",stdin);
	#endif
	char s[100000],a[100000];
	cin>>s;
	int c=0,e=1,k=strlen(s);
	for(int i=0;i<k;i++){
		for(int j=0;j<k;j++){
			a[c++]=s[(i+j)%k];
		}
		if(strcmp(s,a)==0) break;
		e++;
	}
	cout<<e<<endl;
}

#include <iostream>
#include <algorithm>
#include <cmath>
using namespace std;

int main(){
	string s;
	cin >> s;
	int cnt =0;
	for(int i=0; i<s.size(); i++){
		bool flag = false;
		for(int j=0; j<i; j++){
			if(s[i] == s[j]){
				flag = true;
//				break;
			}
		}
		if(!flag)
			cnt ++;
	}
	cout << cnt;
	return 0;
}

#include <stdio.h>
#include <string.h>

int main(){
char str[105];
int ans[30] = {0};
scanf("%s", str);
int ctr = 0;
int flag = 0;
int x = 0;
for(int i = 0; i < strlen(str);i++){
	if(str[i] != str[0]){
	 flag = 1;
	}
}
if(flag == 0){
	printf("1");
	return 0;
}
int leng = strlen(str)/2;
while(leng >= 2){
if(strlen(str) % leng != 0){
	leng--;
	continue;
}
	if(str[x] == str[x + leng]){
		ctr++;
		if(ctr == strlen(str) - leng){
			printf("%d", leng);
			return 0;
		}
		x++;
	}else{
		x = 0;
		ctr = 0;
		leng--;
	}
}
printf("%d", strlen(str));
return 0;
}

#include <string>
#include <iostream>
#include <stdio.h>
using namespace std;
int main(){

    string str;
    int sum=0;
    cin >> str;
    string str1 = str;
    for(int i=0;i<str.size();i++){
        //string str1;
        str1[0]=str[str.size()-1];
        for(int j=1;j<str.size();j++){
            str1[j]=str[j-1];
        }
        if(str!=str1){
            sum++;
        }else{
            break;
        }

    }
    if(sum=0){
        cout << "1";
    }
    if(sum>0){
        cout << sum;
    }
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
int ar[100009];
int main()
{
    int a,b,c,i,j,k;
    string ch;
    cin>>ch;
    a=ch.size();
    for(i=0;i<a;i++)
    {
        b=ch[i]-97;
        ar[b]++;
    }
    for(i=0;i<=100;i++)
    {
        if(ar[i]>0)
        {
            a=a-(ar[i]-1);
        }
    }
    cout<<a;
}

#include <bits/stdc++.h>
#include <ext/numeric>

using namespace std;
using namespace __gnu_cxx;

typedef long long ll;
typedef unsigned long long ull;

set<string>st;
int main ()
{
    string s ;
    cin >> s ;
    string cp;
    for(int i=1; i<=s.size(); ++i)
        {
        cp=s[s.size()-i]+s;
        cp.erase(s.size()-1,1);
        st.insert(cp);
        }
    cout<<st.size()<<endl;

    return 0 ;

}

#include <iostream>
#include <bits/stdc++.h>
#include <string>
using namespace std;
int x,y,z,ans,i,j,k;
string a,b,c;
int main(){
cin>>a;
sort(a.begin(),a.end());

for(i=0;i<a.size();i++){
if(a[i]!=a[i+1]) k++;

}
cout<<k;}

#include<iostream>
#include<string>
using namespace std;
int Search[27]={0};
int main (){

    string Data1;
    cin >> Data1;
    for(int i=0 ; i<Data1.size() ; i++)
         Search[Data1[i]-'a']++;
    int Attacted=0 , c=0;
	for(int i=0 ; i<27 ; i++)
	{
        if(Search[i]!=0)
        {
		   if(Search[i]<=3)Attacted++;
		   else Attacted+=2;
		   c++;
		}
	}
	if(c==1)Attacted--;
    cout << Attacted;
    return 0;
}

#include <bits/stdc++.h>
#define ll long long int
#define pi 3.14
#define endln "\n"
#define _Open_Minded_Short_Code_ return 0;
using namespace std;
vector<ll> ve;
stack <ll> st;
set <ll> se;
map<ll,ll> mp;
int a[1000007];
ll _na(char a){
	if(a=='u' || a=='e' || a=='o' || a=='a' || a=='i' || a =='y'){
		return 1;
	}else{
		return 0;
	}
}
ll _gcd(ll a,ll b){
	if(b == 0) return a;
	else
	return _gcd(b , a%b);
}
ll _nt(ll n){
	if(n<2) return 0;
	else
	for(int i=2;i*i<=n;i++)
	if(n%i==0) return 0;
	return 1;
}
ll powMod(ll a, ll n, ll m) {
    if(n == 0) return 1%m;
    if(n == 1) return a%m;
    ll t = powMod(a,n/2,m) % m;
    t = (t * t) % m;
    if(n % 2)
    	t = (t * a) % m;
    return t%m;
}

int main(){
	string s;
	cin>>s;
	int m = s.length();
	int dem = 0;
	ll h;

	for(int i=0;i<m;i++){
		if(s[i+1] != s[0]){
			dem++;
		}else{
		  	if(s[i+1] == s[0] && s[i] == s[m-1]){
		  		dem++;
				cout<<dem<<endl;
				return 0;
			}else if(s[i+1] == s[0] && s[i] != s[m-1]){
				dem++;
			}
		}
	}
	cout<<dem<<endln;
	// a b c d e a b c d e
	_Open_Minded_Short_Code_
}

#include<bits/stdc++.h>
#define x first
#define y second
#define rep(i,a,b) for(int i=a;i<=b;i++)

using namespace std;
typedef long long INT;
typedef vector<int> vec;
typedef pair<int,int> pi;
char s[100];
int a[200];
int main(){
#ifndef ONLINE_JUDGE
	freopen("in.in","r",stdin);
	freopen("out.out","w",stdout);
#endif
	cin>>s;
	int l=strlen(s);
	for(int i=0;i<l;i++) a[s[i]]++;
	int r=0;
	for(int i='a';i<='z';i++){
		if(a[i]) r++;
	}
	cout<<r<<endl;
	return 0;
}

#include<iostream>
using namespace std;
int main()
{
	int i,j,x;
	string s;
	cin>>s;
	int count=0;
	char c=s[0];
	int flag=0;
	for( i=0;i<s.length();i++)
	{
		if(c==s[i])
		continue;
		else
		break;
	}
	if(i==s.length())
	{
		cout<<"1";
		 flag=1;
	}
	if(flag==0)
	{
		 j=(s.length())/2;
		for( i=0;i<(s.length())/2;i++,j++)
		{
			if(s[i]==s[j])
			continue;
			else
			break;
		}
		if(j==s.length())
		{
			cout<<(s.length()/2);
			flag=1;
		}
	}
	if(flag==0)
	{
		x=s.length();
		cout<<x;
	}

}

#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long n,m,i;
    string s;
    set<char>st;

    cin>>s;

    n=s.length();

    for(i=0;i<n;i++)
    {
        st.insert(s[i]);
    }

    m=st.size();

    cout<<m<<endl;

   //main();
}

#include <iostream>
#include <vector>
#include <string>

using namespace std;

int main()
{
    vector <string> S;
    string str;
    cin>>str;
   // S.push_back(str);

    string buf;

    int ind=str.size();

    if(ind==2)
    {
        if(str[0]==str[1])
        {
            cout<<1<<endl;
            return 0;
        }
    }

    for(int j=0; j<str.length()-1; j++)
    {
    buf.push_back(str[ind-1]);
    for(int i=0; i<str.length()-1; i++)
    {
    buf.push_back(str[i]);
    }
    str=buf;
    buf.clear();
    //cout<<str<<endl;
    S.push_back(str);
    }

    int ans=S.size()+1;

    for(int i=0; i<S.size(); i++)
    {
        for(int j=0; j<S.size(); j++)
        {
            if(S[i]==S[j] && i!=j)
            {
                ans--;
            }
        }
    }

    cout<<ans<<endl;

    return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,i,j,d=0;
    char a[100],b[100],c[100];
    cin>>a;
    n=strlen(a);
    strcpy(c,a);
    for(j=0;j<n;j++)
    {
        for(i=1;i<n;i++)
        {
            b[i-1]=a[i];
        }
        b[n-1]=a[0];
       // strcpy(a,b);
       for(i=0;i<n;i++)
       {
           a[i]=b[i];
       }
        d++;
        if(strcmp(b,c)==0)
            break;

    }
    cout<<d<<endl;
   // for(i=0;i<n;i++)
        //cout<<b[i];
}

#include<iostream>
using namespace std;
int main()
{
	int n(6),k,x(0),y(1);
	char j;
	char c[n];
	for(k=0;k<n;k++){
		cin>>j;
		c[k]=j;
	}
	for(k=1;k<n;k++){
		if(c[0]==c[k]){
			y++;
		}
}
if(n%y==0){
   for(k=0;k<n/y;k++){
   		for(int t=1;t<y;t++){
		    if(c[k]!=c[k+t*(n/y)])
		        x++;
		    if(x!=0)
				break;
	    }
			if(x!=0)
			    break;
	}
		if(x!=0){
	    	cout<<n;
		}
		else{
			cout<<n/y;
    	}
}
else{
    cout<<n;
}
    return 0;
}

#include<bits/stdc++.h>
using namespace std;

#define mx 1000
#define mod 1000000007
#define f(i,n) for(int i=0;i<n;i++)
#define f1(i,n) for(int i=1;i<=n;i++)

#define r(i,n) for(int i=n-1;i>=0;i--)
#define fv(a,b,c) for( a=b;a<=c;a++)
#define rv(a,b,c) for(int a=b;a>c;a--)
#define re return
#define pb(a) push_back(a)
#define mp(a,b) make_pair(a,b)
#define re return
#define fir first
#define sec second
#define ll long long int
#define str string
#define yes  cout<<"YES"
#define no    cout<<"NO"
#define pt(a)    cout<<a<<endl
#define spt(a)  cout<<a<<" "
#define sf(a)    cin>>a
#define en     cout<<endl

int dp[51]={0};
bool vis[1000]={0};
bool sortbysec(const pair<int,int> &a,const pair<int,int> &b){
    return(a.second<b.second);
}

ll myXOR(ll x, ll y)
{
   return (x | y) & (~x | ~y);
}

void primeFactors(int n,map<int,int> &mp)
{
    for (int i=1;i<=n;i++)
        if (n%i==0)
            mp[i]++;
}
bool isPrime(int n)
{

    if (n <= 1)
        return false;

    for (int i = 2; i < n; i++)
        if (n % i == 0)
            return false;

    return true;
}
int main(){
  int n;
  cin>>n;
  string s,s1="";
  cin>>s;
  f(i,n){
      if(n%2==0){
      if(i%2==0)
      s1=s1+s[i];
      else
       s1=s[i]+s1;}
       else{
               if(i%2==0)
              s1=s[i]+s1;
              else
              s1=s1+s[i];

       }

  }
  reverse(s1.begin(),s1.end());
  pt(s1);

}

#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
int main()
{
	char c[100][55],s[55];
	int faut;
	while(~scanf("%s",s)){
		int l=strlen(s);
		strcpy(c[0],s);
		int num=1;
	   for(int i=1;i<l;i++){
	   	faut=0;
	   	for(int j=0;j<i;j++)
	   	c[i][j]=s[l-i+j];
	   	for(int n=i;n<l;n++)
	   	c[i][n]=s[n-i];
	   	for(int k=0;k<i;k++){
	   		if(strcmp(c[i],c[k])==0){
	   			faut=1;break;
			   }
		   }
		   if(faut==0)
		   num++;
	   }
	   printf("%d\n",num);
	}
	return 0;
}

#include <bits/stdc++.h>

using namespace std;

int main()
{
   string s;
   cin >> s;
   set <string> c;
   for (int i = 0; i < s.size(); i++){
        string s1;
        for (int k = 1; k < s.size(); k ++ ){
            s1 += s[i];
        }
   s1 += s[0];
   c.insert(s1);
   }
   cout << c.size();
}

#include <bits/stdc++.h>
using namespace std;
map <int, int> mp;
int main()
{
    int i, j, k, n, m, t, p, cas=1;
    char arr[101];
    scanf("%s", arr);
    m=0;
    p=strlen(arr);
    for( i=0; i<p; i++)
    {
        mp[arr[i]-'a']++;
        //aprintf("%d ", arr[i]-'a');
    }
    for( i=0; i<26; i++)
    {
        if(mp[i]>=2)
        {
            m++;
        }
    }
    if(m==0) m=1;
    printf("%d\n", p/m);
    return 0;
}

#include <iostream>
#include <bits/stdc++.h>

using namespace std;

int main()
{
    string w;
    cin>>w;
    int n=w.size()+1;
    if(n>26)
    {
        return 0;
    }
    set<char>st(w.begin(),w.end());
    cout<<st.size()<<endl;

    return 0;
}

#include<iostream>
#include<bits/stdc++.h>
using namespace std;

int main()
{

	string s,t,r;
	size_t found;
	cin>>s;
	t=s;
	r=s;

	int l,count=1;
	l=s.length();
	for(int i=0;i<l-1;i++)
	{
		t=t[l-1]+" "+t.substr(0,l-1);

		  found=r.find(t);
  if(found==string::npos)
			count++;
		r=r+t;
	}
	cout<<count;

		return 0;
	}

#include <bits/stdc++.h>
#define endl '\n'
#define ALL(V) V.begin(), V.end()
#define L_B lower_bound
#define U_B upper_bound
#define pb push_back
#define ll long long
#define rep(i,n) for (i = 0; i < n; ++i)
#define REP(i,k,n) for (i = k; i <= n; ++i)
#define REPR(i,k,n) for (i = k; i >= n; --i)
using namespace std;
template<class T, class T1> int chkmin(T &x, const T1 &y) { return x > y ? x = y, 1 : 0; }
template<class T, class T1> int chkmax(T &x, const T1 &y) { return x < y ? x = y, 1 : 0; }
const int MAXN = (1 << 20);

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
#ifndef ONLINE_JUDGE
   freopen("input.txt", "r", stdin);
   //freopen("error.txt", "w", stderr);
   freopen("output.txt", "w", stdout);
#endif

 ll T = 1 ;
 //cin>>T;

 for(ll t=0;t<T;t++)
 {
  string s;
  cin>>s;
  string ts = s;
  ll f = 0 ,n = s.size() , ans = 0;
  for(ll i=0;i<n;i++)
  {
    char ch = ts[n-1];
    for(ll i=1;i<n;i++)
      ts[i] =ts[i-1];
    ts[0] = ch;
    if(ts==s)
      break;
    ans++;
    f = 1;
  }
  if(f)
  cout<<ans;
else cout<<1;
 }
  return 0;

}

#include <bits/stdc++.h>
#define maxn (int)(1e4)
#define sf scanf
#define pf printf
using namespace std;
//int deg[maxn+10];
int main() {
	// your code goes here
	int n,deg,sum;
	char s[100];
	set<char>S;
	int freq[26] = {0};
	sf("%s",s);
	int len = strlen(s);
	for(int i=0;i<len;i++)
	{
	    S.insert(s[i]);
	}
	pf("%d\n",S.size());
	fflush(stdout);
	return 0;
}

// Author - abbi_18
#include<bits/stdc++.h>
#include <stdint.h>

using 			namespace 			std;

#define 		ff 					first
#define 		ss 					second
#define 		pb 					push_back
#define 		mp 					make_pair
#define 		eps 				1e-9
#define 		inf 				1e18
#define 		PI 					3.14159265
#define 		mset(A,num,n);   	memset(A,num,n);
#define 		all(a) 				a.begin(),a.end()
#define 		allr(a) 			a.rbegin(),a.rend()
#define			nl					cout << endl
#define 		vi					vector<int>
#define 		vll					vector<ll>
#define 		pi					pair<int,int>

#define 		trace1(x)	             	cout <<#x<<": "<<x<< endl;
#define 		trace2(x, y)             	cout <<#x<<": "<<x<<" | "<<#y<<": "<<y<< endl;
#define 		trace3(x, y, z)          	cout <<#x<<": "<<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl;
#define 		trace4(a, b, c, d)       	cout <<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl;
#define 		trace5(a, b, c, d, e)    	cout <<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<<": "<<e<<endl;

const int 		MOD = 				1e9+7;
const int 		N   = 				1e6+5;

typedef 		long long int 		ll;
typedef 		int64_t 			lln;

ll POWER[65];
ll aonb(ll a, ll b) {ll ret=1;while(b) {if(b&1) ret*=a;a*=a;if(ret>=MOD) ret%=MOD;if(a>=MOD) a%=MOD;b>>=1;}return ret;}

void precompute() {
	POWER[0]=1;
	for(int i=1;i<63;i++) POWER[i]=POWER[i-1]<<1LL;
}

int main()
{
//  freopen("A-large-practice.in","rt",stdin);
//	freopen("one.out","wt",stdout);
	std::ios_base::sync_with_stdio(false);
//	std::cout << std::setprecision(10) << std::fixed;

	string str;
	cin >> str;
	int n = str.size();

	if (n%2 != 0){
		cout << n;
		return 0;
	}

	for (int i=1;i<=n/2;i++){
		int check=1;
		for (int j=0;j<n-i+1;j+=i){
			for (int k=j;k<j+i;k++){
				if (str[k] != str[k-j]){
//					trace3(i,k,k-j);
					check=0;
				}
			}
		}
		if (check){
			cout << i;
			return 0;
		}
	}
	cout << n;
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
    string s;
    cin>>s;
    int cnt =0 ;
    sort(s.begin(),s.end());
    for(int i = 0; i < s.size(); i ++)
    {
        if(s[i]!=s[i+1])
            cnt++;
    }
    cout<<cnt<<endl;
}

#include <iostream>
#include<string.h>
using namespace std;

int main() {
	// your code goes here
	char s[55];
	cin>>s;
	int l=strlen(s);
	int i,j=1;
	for(i=0;i<l&&j<l;)
	{
		if(s[i]!=s[j])
		{
			j++;
			i=0;
		}
		else
		{
			i++;
			j++;
		}

	}
	cout<<j-i;
	return 0;
}

#include <cstdio>
#include <cstring>
#include <cstdlib>

bool table[2000000];
char s[102];

int hash(int o) {
	int v = 0, j = 1;
	for (int i = o; i < o + strlen(s); ++i)
		v += (s[o] - 'a' + 1) * j++;
	return v;
}

int main() {

	scanf("%s", s);
	sscanf(s, "%s", &s[strlen(s)]);
	s[strlen(s) * 2] = '\0';
	//printf("%s", s);

	memset(table, false, sizeof(table));

	int distinct = 0;
	for (int i = 0; i < strlen(s); ++i) {
		int v = hash(i);
		if (!table[v]) {
			++distinct;
			table[v] = true;
		}
	}
	printf("%d\n", distinct);

	return 0;
}

#include<bits/stdc++.h>
#define ll long long int
using namespace std;
int main()
{
    ll n,i,c=0;
    string s;
    cin>>s;
    n=s.size();
    sort(s.begin(),s.end());
    for(i=0;i<n-1;i++){
        if(s[i]!=s[i+1])
            c++;
    }
    cout<<c+1<<endl;
}

#include<iostream>
#include<string>
#include<cmath>
using namespace std;
int main()
{
		string s,s1,s2;
		cin >> s;
		int x = s.size(), countt = 0;

		for (int i = 1; i <x; i++)
		{
			if (s.at(0) == s.at(i))
				countt++;
		}
		if (countt == x-1)
		{
			cout << "1";
		}
		else
		{
			if (x % 2 == 0)
			{
				s1 = s.substr(0, x / 2 );
				s2 = s.substr(x / 2, x-1);
				if (s1 == s2)
					cout << x / 2;
				else
					cout << x;
			}
			else
				cout << x;
		}

	}

#include <bits/stdc++.h>
using namespace std;

#define pb push_back
#define mp make_pair
#define fir first
#define sec second
#define elif else if
#define int long long

typedef pair<int, int> pii;
typedef vector<int> vi;
typedef long long ll;

int mx=1e9;
int n, m, len, cnt=1, ans=mx, x, y, k;
int dist[1005][1005], a[200000];
bool visit[1005][1005];
vector <char> g[100];

main()
{
    bool prov=true;
    string s;
    cin >> s;
    k=s.length();
    for(int i=1; i<=k; i++)
    {
        prov=true;
        for(int j=0; j<k-i; j++)
        {
            if(s[j]!=s[j+i])
            {
                prov=false;
                break;
            }
        }
        if(prov==true&&i!=k&&i!=1)
        {
            ans=i;
            break;
        }
        elif(prov==true)
        {
            ans=k/i;
            break;
        }
    }
    if(ans==1)cout<<k;
    elif(ans==k)cout<<1;
    else cout << ans;

    return 0;
}

#include <bits/stdc++.h>

using namespace std;

using ll = long long;
using str = string;
using unll = unsigned long long;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<std::string> vs;
typedef vector<char> vc;
typedef set<int> si;
typedef set<std::string> ss;
typedef set<char> sc;

#define all(v)   ((v).begin()),((v).end())
#define sz(v) ((int)((v).size()))

int max_index(vi vi1) {
    int x = (max_element(all(vi1))) - vi1.begin();
    return x;
}

int min_index(vi vi1) {
    int x = (min_element(all(vi1))) - vi1.begin();
    return x;
}

int main() {
    //    ios::sync_with_stdio(false);

    str s;
    int ans = 1;
    cin >> s;
    sort(all(s));

//    cout << s <<'\n';
    for (int i = 1; i < s.size(); ++i) {
        if (s[i] != s[i - 1]) {
            ++ans;
        }
    }

    cout << ans <<'\n';

    return 0;
}
//15 18432

#include<iostream>
#include<vector>
#include<string>
#include<set>

using namespace std;

int main() {

   string str;
   cin >> str;
   set<char> st;
   for(int i = 0; i < str.size(); i++)
        st.insert(str[i]);

    cout << st.size() << endl;
}

#include<iostream>
#include<math.h>
#include<string>
using namespace std;
int main()
{
	string word;
	string tmp;
	int cot=1;
	cin>>word;
	int c=word.size();
	tmp=word;
	tmp[0]=word[c];
	while(tmp!=word)
	{
		cot++;
		c--;
		tmp[0]=word[c];
	}
	cot-=1;
	cout<<cot<<endl;
	return 0;
}

#include <iostream>
#include <bits/stdc++.h>

using namespace std;

int main(){

	string cad;
	set<string> words;
	cin >> cad;
	words.insert(cad);
	int len = cad.size();
	for(int i = 0; i < cad.size(); i++){
		char c[1];
		c[0] = cad[len-1];
		cad.erase(cad.end()-1);
		cad.insert(0,c);
		words.insert(cad);
	}

	cout << words.size() << endl;

	return 0;
}

#include <set>
#include <cstring>
#include <algorithm>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <queue>
#include <stack>
#include <vector>

#define  mp make_pair
#define pb push_back
#define  X first
#define  Y second

using namespace std;
typedef long long LL;
const int maxn = 1005;
int n, a[maxn];
char s[maxn];
vector<char>t;
void init() {
    scanf("%s", s);
    int len = strlen(s);
    for(int i = 1; i <= len; i++) {
        bool flag = 0;
        t.clear();
        for(int j = 0; j < i; j++) {
            t.push_back(s[j]);
        }
        int k = 0;
        for(int j = 0; j < len; j++) {
            if(s[j] != t[k]) {
                flag = 1;
                break;
            }
            k = (k + 1) % i;
        }
        if(!flag) {
            cout << i << endl;
            return ;
        }
    }
}

int main() {
#ifdef LOCAL
    freopen("in.txt", "r", stdin);
#endif // LOCAL
    init();
    return 0;
}

#include <cstdio>
#include <cstring>

using namespace std;

const int maxn=51;

char str[maxn];
int fail[maxn]={0};

int getint()
{
	char ch;int b=1;
	for(ch=getchar();ch>'9'||ch<'0';ch=getchar())if(ch=='-')b=-1;
	int num=ch-'0';
	for(ch=getchar();ch>='0'&&ch<='9';ch=getchar())num=num*10+ch-'0';
	return num*b;
}

int main()
{
	scanf("%s",str+1);
	fail[1]=0;
	int n=strlen(str+1);
	for(int i=2;i<=n;i++)
	{
		int j=fail[i-1];
		while(str[j+1]!=str[i]&&j)j=fail[j];
		if(str[j+1]==str[i])j++;
		fail[i]=j;
	}
	if(n-fail[n]>n/2)printf("%d\n",n);
	else printf("%d\n",n-fail[n]);
	return 0;
}

#include<bits/stdc++.h>
using namespace std;

int main(){

	string s;
	cin>>s;
	vector<int> v;
	int c=1;
	sort(s.begin(),s.end());

	for(int i=0; i<s.size()-1; i++){
		if(s[i]==s[i+1]){
			c++;
		}
		else {
			v.push_back(c);
			c=1;
		}
	}
	v.push_back(c);

	sort(v.begin(),v.end());

	cout<<s.size()/v.front();

	return 0;
}

#include<iostream>
#include<iomanip>
#include<cmath>
#include<string>
#include<cctype>
#include<algorithm>
#include<set>
#include<map>
using namespace std;

string as[55];
int ax[55];

int main(){
string s;
cin>>s;
int x=s.size();
char c[x+1],d[x][x];
for(int i=0;i<x;i++){
	c[i+1]=s[i];
	d[0][i]=c[i+1];
}
for(int i=1;i<x;i++){
	swap(c[0],c[x]);
	for(int j=0;j<x;j++){
		d[i][j]=c[j];
	}
	for(int j=x+1;j>=1;j--){
		c[j]=c[j-1];
	}
}

int n=0;
for(int k=0;k<x;k++){
	for(int i=0;i<x;i++){
		as[k]=as[k]+d[k][i];
	}
}

n=0;
for(int i=0;i<x;i++)
	for(int j=i+1;j<x;j++)
		if(as[i]!=as[j]&&(ax[i]==0&&ax[j]==0)){
			n++;
		}
		else{
			ax[j]=1;
		}

int sss=0;
for(int i=1;i<=x-1;i++){
	sss+=i;
}

if(sss==n){
	cout<<x;
	return 0;
}

if(n==0){
	cout<<1;
	return 0;
}
cout<<n-1;
return 0;
}

#include<iostream>
#include<cstdio>
using namespace std;

int main(){
	string a;int i,ans=0,s[30];
	cin>>a;
	for(i=0;i<=27;i++)s[i]=0;
	for(i=0;i<=a.size()-1;i++)
		s[a[i]-'a'+1]++;
	for(i=1;i<=26;i++)if(s[i]>=1)ans++;
	cout<<ans<<endl;
	return 0;
}

#include <iostream>
#include <bits/stdc++.h>

using namespace std;

int main()
{
     ios_base::sync_with_stdio(0);
	cin.tie(0),cout.tie(0);

    string w;
    cin>>w;
    int n=w.size();
    if(n>26&&n==0)
    {
        return 0;
    }
    set<char>st(w.begin(),w.end());
    cout<<st.size()<<endl;
    return 0;
}

#include<algorithm>
#include<iostream>
#include<string.h>
#include<map>
using namespace std;
int main()
{
    map<string,int>mp;
    int i,n,ar[128]={0},sum=0,j;
    string a;
    cin>>a;
    for(i=0;i<a.size();i++)
    {
        ar[a[i]]++;
    }
    sort(ar,ar+128);
    reverse(ar,ar+128);
    for(i=0;i<128;i++)
    {
        if(ar[i]==0) break;
    }
    for(j=0;j<i-1;j++)
    {
        sum+=ar[j]-ar[j+1];
    }
    cout<<i+sum<<endl;

    return 0;
}

#include <bits/stdc++.h>

using namespace std;

int main() {
	// your code goes here

    string s;
    cin >> s;
    vector<string> a;
    a.push_back(s);
	int l=s.length();int c=0;
	for(int i=1;i<l-1;i++)
	{
	    string s1=s.substr(i,l);
	    string s2=s.substr(0,i);
	    string s3=s1+s2;
	    a.push_back(s3);
	}
	for(int i=0;i<l;i++)
	{
	    for(int j=i+1;j<l;j++)
	    { string q=a[i],w=a[j];cout<<q<<endl;
	        if(q==w)
	        c++;

	    }}
	    printf("%d",(l-c));
	return 0;
}

#include <iostream>
#include <bits/stdc++.h>

using namespace std;

int main()
{
    string w;
    cin>>w;
    set<char>st(w.begin(),w.end());
    cout<<st.size()<<endl;

    return 0;
}

#include <bits/stdc++.h>
using namespace std;

typedef long long ll;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    string s;
    cin >> s;
    int ans = 0;
    bool done = false;
    while (!done) {
        bool temp = true;
        ans++;
        for (int i = 0; i < s.size() - ans; i++) {
            if (s[i] != s[i + ans]) {
                temp = false;
            }
        }
        done = temp;
    }

    if (ans > ((int)s.size()) / 2) {
        ans = s.size();
    }
    cout << ans << endl;
}

#include <bits/stdc++.h>

using namespace std;

string s[110];

int main()
{
	int cnt = 0, ans = 0;
	string txt;

	cin >> txt;

	for(int i = 0; i < txt.size(); ++i)
	{
		if(txt[i] == s[cnt][0])
			cnt++;

		s[cnt] += txt[i];
	}

	ans = s[0].size();

	for(int i = 1; i <= cnt; ++i)
		if(s[i] != s[i - 1])
			ans += s[i].size();

	cout << ans << endl;

	return 0;
}

//
//  main.cpp
//  ioi
//
//  Created by Arkalyk Akash on 12/17/16.
//  Copyright © 2016 Arkalyk Akash. All rights reserved.
//

#include <bits/stdc++.h>

using namespace std;

int main() {
    int ans = 0;
    string s;
    cin >> s;
    sort(s.begin(),s.end());
    for (int  i = 0; i < s.size();i++){
        s[i] = tolower(s[i]);
        if (s[i] != s[i + 1]){
            ans++;
        }
    }
    cout << ans;
    return 0;
}

#include<stdio.h>
#include<string.h>
int main()
{
    int i,j,len,ans=0,c;
    char s[51];
    scanf("%s",s);
    len=strlen(s);
    for(i=0;i<len;i++)
    {
        c=0;
        for(j=i+1;j<len;j++)
        {
            if(s[i]==s[j])
                c++;
        }
        if(c==0)
            ans++;
    }
    printf("%d\n",ans);
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
#define faster() ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define endl '\n'
int main()
{
    faster();

    string s;
    cin>>s;
    int cnt=0;
    map<char , int> mp;
    //bool ok=0;
    for(auto u : s){
        mp[u]++;
        if(mp[u] < 2 ) cnt++;
    }
    cout<<cnt<<endl;
	return 0;
}

#include<bits/stdc++.h>

using namespace std;

int main(){
	string s;
	cin >> s;
	int sum = 0;
	int k = s.length();
	int a[s.length()];
	bool used[s.length()];
	for (int i = 0; i < k; i ++){
		swap (s[0], s[i]);
		sum ++;
	}
	cout << sum;
}

#include<bits/stdc++.h>
using namespace std;
#define int long long int
typedef long double ld;
#define forw(i,a,b) for(int i=a; i<b;i++)
#define rev(i,a,b) for(int i=a;i>=b;i--)
#define endl '\n'
#define ff first
#define ss second
#define all(a) a.begin(),a.end()
#define mxe max_element
#define mne min_element
#define pb push_back
#define mp make_pair
#define vi vector<int>
#define pi pair<int,int>
#define size(a) (int)(a.size())
int inf=1e9;
const int mod = 1e9 + 7;
vector<bool> visited(1e5 +1);
int cats=0;
int ans=0;

void solve(){
    string s;
    cin>>s;
    int n=size(s);
    set<string> se;
    se.insert(s);
    int ans=1;
    forw(i,1,n){
        string temp= s.substr(n-1-i,i) + s.substr(0,n-i);
        if(!se.count(temp)){
        	se.insert(temp);
        	ans++;
        }
    }
    cout<<ans;

}

signed main(){
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    //
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
    //
	int test;
	//cin>>test;
	test=1;
	while(test--){
         solve();
         cout<<endl;
	}
}

#include <bits/stdc++.h>

using namespace std;

bool check(string x , int n)
{
    for(int i=0;i<x.size();i++)
    {
        if(x[i]!=x[i%n])
        {
            return false;
            break;
        }
    }
    return true;
}

int main ()
{
  string x , y;
  cin>>x;
  y+=x;
  int n = x.size();
  sort(y.begin() , y.end());
  y.erase(unique(y.begin() , y.end()) , y.end());
  int u = y.size();
  if(n%u==0 && check(x , u) || u==1)
  {
      cout<<u<<endl;
  }
  else
  {
       cout<<n<<endl;
  }
  return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main(){

    string x,b;
    set<char>st;
    cin>>x;
    map<string,int>mp;
    int cnt=0;
    for(int i=x.size()-1;i>=0;i--){
        b=x[i];
        for(int j=1;j<x.size()-1;j++)
            b+=x[j];
        if(mp[b]==0){
            mp[b]=1;
            cnt++;
        }
    }
    cout<<cnt<<endl;

}

#include<iostream>
#include<string>
using namespace std;
int Search[27]={0};
int main (){

    string Data1;
    cin >> Data1;
    for(int i=0 ; i<Data1.size() ; i++)
         Search[Data1[i]-'a']++;
    int Attacted=0 , c=0;
	for(int i=0 ; i<27 ; i++)
	{
        if(Search[i]!=0)
        {
		   if(Search[i]<=3)Attacted++;
		   else Attacted+=2;
		   c++;
		}
	}
	if(c==1)Attacted--;
    cout << Attacted;
    return 0;
}

#include <iostream>
#include <string>
using namespace std;

// Solved after contest
// find minimal length of cycle in string
// Ex.: abababab => minlength = 2, cycle is ab
// Short version without permutations
int main()
{
    string s;
    cin >> s;
    size_t length = 1;
    for (size_t i = 1; i < s.size(); ++i)
    {
        if (s[i-length] != s[i])
            i = ++length;
    }
    cout << length << endl;
    return 0;
}

#include<bits/stdc++.h>
using namespace std;

//#define ll long long int
int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    string s;
    cin>>s;
    int n=s.length();
    int arr[26];
    memset(arr,0,sizeof arr);
    for(int i=0; i<n; i++)
    {
        arr[s.at(i)-97]++;
    }
    int cnt=0;
    int d=0;
    for(int i=0; i<26; i++)
    {
        if(arr[i]==0)
        {
            d++;
        }
    }
    if(d==25)
    {
        cnt=1;
    }
    else
    {
        for(int i=0; i<26; i++)
        {
            // cout<<arr[i]<<endl;
            if(arr[i]==1)
            {
                cnt++;
            }
            else if(arr[i]>1)
            {
                cnt=cnt+arr[i]-1;
            }
        }
    }

    cout<<cnt<<endl;
    return 0;
}

#include<iostream>
#include<string>
using namespace std;
int main()
{
	int n,k,x(0),y(1),i,z(0),l;
	char j;
	char c[50];
	std::string str;
	cin>>str;
  n= str.length();
  std::size_t length = str.copy(c,n,0);
  c[length]='\0';
	for(k=1;k<n;k++){
		i=0;
		for(int t=0;t<k;t++){
			if(c[k]==c[t]){
				i=1;
				break;
			}
		}
		if(i==0){
		y++;
		z=k;
		}
	    }
	l=z;
	for(k=z+1;k<n;k++){
		if(c[z]==c[k]){
			l++;
		}
		else break;
	}
	if(y==1){
		cout<<1;
	}
	else if(n%(l+1)==0){
		z=l+1;
    for(k=0;k<z;k++){
   		for(int t=1;t<n/z;t++){
		    if(c[k]!=c[k+t*z])
		        x++;
		    if(x!=0)
				break;
	    }
			if(x!=0)
			    break;
	}
		if(x!=0){
	    	cout<<n;
		}
		else{
			cout<<z;
    	}
	}
	else{
    	cout<<n;
	}
    return 0;
}

#include <iostream>
using namespace std;
#include <string>
#include <algorithm>
#include <cctype>
#include <math.h>

int main()
{
	string s, j, r;
	float x = 1;
	cin >> s;
	r = s;
	char c = s[0];
	int k = 1;
	for (int i = 1;i < s.length();i++)
	{
		//while (i == s.length() - 1)
		for (int o = 1;o < s.length();o++)
		{
			j = j + s[o];
		}

		j = j + c;
		//j[j.length() + 1] = NULL;
		if (j == r)
		{
			if (i == 2)
			{
				break;
			}
		}
		else
			x++;
		//cout << s;
		k++;
	//	cout << j;
		s = j;
		c = s[0];
		j.erase();
	}
	j.erase();
	for (int i = 0;i < s.length() / 2;i++)
	{
		j = j + s[i];
	}
	string b;
	for (int i = s.length()/2;i < s.length();i++)
	{
		b = b + s[i];
	}
	if (j == b)
	{
		x = (x+1) / 2;
		floor(x);
		cout << x;
	}
	else
		cout << x;

	//char r = s[s.length() - 1];
	//for (int i = s.length()-2;i > 0;i--)
	//{
	//	if (i == 1)
	//	{
	//		s[0] = r;
	//	}
	//	else
	//		s[i + 1] = s[i];
	////	cout << s;
	//	if (j.compare(s) == 0)
	//	{
	//	}
	//	else
	//		x++;
	//}
	//cout << s;
	//cout <<x;
}

#include<bits/stdc++.h>
using namespace std;
string s;
long long a,b;
int main()
{
 cin>>s;
 a=s.size();
 for(int i=0;i<s.size();i++)
  {a=0;for(int j=0;j<s.size();j++)
  {
   if(s[i]==s[j] && i>j) {a++;s[j]='0';}
   if(s[i]==s[j] && i<j) {a++;s[i]='0';}
  }if(a==0) b++;}
cout<<b;
}

#include <stdio.h>
#include <string.h>

int main(){
	char s[55];
	int a,b,c;
	scanf("%s",s);
	a=strlen(s);
	b=1;
	c=0;
	for(int i=1;i<a;i++){
		if(s[i]!=s[0]){
			b++;
		}
		if(s[i]==s[0]) {
			i=a;
		}
	}
	int i=0;
	char t[b];
	for(int i=0;i<b;i++){
		t[i]=s[i];
	}
	while(i<a){
		for(int j=0;j<b;j++){
			if(s[i]!=t[j]){
				c++;
			}
			i++;
		}
	}
	if(c==0){
		printf("%d",b);
	}
	if(c!=0){
		printf("%d",a);
	}
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main(void)
{
    string s;
    int arr[26];
    int count=0,min=26;
    memset(arr,0,sizeof(arr));
    cin>>s;
    for(int i=0;i<s.length();i++)
        arr[s[i]-'a']++;
    for(int i=0;i<26;i++)
    {
        //cout<<arr[i]<<endl;
        if(arr[i]<min&&arr[i]!=0)
           min=arr[i];
    }

     for(int i=0;i<26;i++)
    {
        count=count+(arr[i]/min);
    }
    cout<<count<<endl;

    return 0;
}

#include<bits/stdc++.h>
using namespace std;
typedef pair<int,int>   pii;
typedef vector< pii>      vii;
typedef vector<int>     vi;
typedef vector< vi >    vvi;
typedef long long int   LL;
#define pb push_back
#define mp make_pair
#define scan(n) scanf("%d",&n)
#define print(n) printf("%d\n",n)
#define longscan(n) scanf("%lld",&n)
#define longprint(n) printf("%lld\n",n)
#define fast_io ios_base::sync_with_stdio(false);cin.tie(NULL)
/*void sieve(int n)
  {
  for(int i=2;i*i<=100000;i++) for(int j=2*i;j<=100000;j+=i) if(!sie[j]) sie[j]=1;
  }*/
int main()
{
    char s[108];
    cin >> s;
    int l =strlen(s);
    int flag1=0,flag2=0,i=0;
    if(l==1)
    {
        cout << 1 << "\n";
        return 0;
    }
    for(i=1;i<=l/2;i++)
    {
        flag1=0;
        for(int j=0;j<l-i;j++)
        {
            if(s[j]!=s[j+i])
            {
                flag1=1;
                break;
            }
        }
        if(flag1==0)
        {
            flag2=i;
            break;
        }
        else
        {
            flag2=l;
        }
    }
    cout << flag2 << "\n";
    return 0;
}

#include<iostream>
#include<iomanip>
#include<ctype.h>
#include<string>
#include<cmath>
#include<algorithm>
using namespace std;

int main()
{
    cin.tie(0);ios_base::sync_with_stdio(0);
    string s;
    int n=0,h[26]={},i,minn=100000000;
    cin>>s;
    for(i=0;i<s.size();i++)
        h[s[i]-'a']++;
    for(i=0;i<26;i++)
        if(h[i]>0)
            minn=min(minn,h[i]);
    for(i=0;i<26;i++)
    {
        if(h[i]>0)
            n+=h[i]/minn;
    }
    cout<<n;
    return 0;
}

#include <iostream>
#include <algorithm>
#include <iomanip>
#include <string>
#include <cmath>
#include <cstdio>
#include <vector>
#include <fstream>
#include <stack>
#include <map>
#include <set>

using namespace std;

#define test        freopen("a.in", "r", stdin)
int main()
{
	//ifstream cin("a.in");
	string a,b;
	cin >> a;
	b = a + a;
	set<string> s;

	for (int i = 0; i < a.size();i++){
		s.insert(a.substr(i, a.size()));
	}
	cout << s.size() << endl;
	return 0;
}

#include <iostream>
#include <vector>
#include <string>
#include <math.h>
#include <algorithm>
#include <cstdio>

using namespace std;

int sum = 0;
int check[100];

int main()
{
	string s;
	cin >> s;
	for(int i = 0; i < s.size(); i++)
	{
		int a = s[i];
		if(check[a] == 0) sum++;
	}
	cout << sum << endl;
	return 0;
}

#include <string>
#include <iostream>
#include <stdio.h>
using namespace std;
int main(){

    string str;
    int sum=0;
    cin >> str;
    string str1 = str;
    for(int i=0;i<str.size();i++){
        //string str1;
        str1[0]=str[str.size()-1];
        for(int j=1;j<str.size();j++){
            str1[j]=str[j-1];
        }
        if(str!=str1){
            sum++;
        }else{
            break;
        }

    }
    cout << sum;
    return 0;
}

#include <bits/stdc++.h>
#include<iostream>
#include <stdio.h>
#define f(i,a,b) for(int i=a; i<b; ++i)
#define f2(j,a,b) for(int j=a; j<b; ++j)
#define F first
#define S second
#define pi 3.1415926536
#define Faast ios_base::sync_with_stdio(0);       cin.tie(0);      cout.tie(0);
#define SIZE 10
#define IN freopen("records.in","r",stdin);
const int MOD = 1e9 + 7;
const int MAX_VAL=1e6+2;
const int INF = 0x3f3f3f3f;
typedef long long ll;
using namespace std;

int main()
{
    Faast;

    string s;
    cin>>s;
    int arr[52]={},cnt=0;
    f(i, 0, s.size())
    {
        if(!arr[s[i]-'a']) ++cnt;
        arr[s[i]-'a']++;
    }
    if(cnt==1) cout<<1<<endl;
    else if(cnt==2&&s.size()%2==0) cout<<s.size()/2<<endl;
    else if(cnt==2&&s.size()%2!=0) cout<<s.size()/2+1<<endl;
    else cout<<s.size()<<endl;

    return 0;
}

#include <stdio.h>
#include <string.h>

int main(){
char str[105];
int ans[30] = {0};
scanf("%s", str);
int ctr = 0;
int flag = 0;
int x = 0;
for(int i = 0; i < strlen(str);i++){
	if(str[i] != str[0]){
	 flag = 1;
	}
}
if(flag == 0){
	printf("1");
	return 0;
}
int j = 2;
while(j <= strlen(str) / 2){
	if(strlen(str) % j != 0){
		j++;
		continue;
	}
	if(str[x] == str[x + j]){
		x++;
		ctr++;
		if(ctr == strlen(str) - j){
			printf("%d", j);
			return 0;
		}
	}else{
		x = 0;
		j++;
	}
}

printf("%d", strlen(str));
return 0;
}

#include <bits/stdc++.h>
using namespace std;

int a[27];

int main(){
    string s;
    cin >> s;
    int ans = 0;
    for(int i = 0; i < 27; i++) a[i] = 0;
    for(int i = 0; i < s.length(); i++){
        if(!a[s[i]-'a']){
            ans++;
            a[s[i]-'a']=1;
        }
    }
    cout << ans << endl;
}

//2019
//From the beginning it wasn't about the ends..

#include <bits/stdc++.h>

#define rep(i,a,n)  for(long long i=a;i<n;++i)
#define rip(i,a,n)  for(long long i=a;i<=n;++i)
#define mrip(i,a,n)  for(long long i=a;i>=n;--i)
#define mrep(i,a,n)  for(long long i=a;i>n;--i)
#define doublerep(i,a,n) for(ll i=a;i<n;i+=2)
#define sf scanf
#define pf printf
#define pb push_back
#define EPS 1e-9
#define inf 1e9
#define MAX 1000001
#define so(ar) sizeof(ar)
typedef long long ll;
using namespace std;
ll pow( ll a,ll b)
{
    if(b==0)
        return 1;
    return a*pow(a,b-1);
}
ll fact(ll a)
{
    if(a==1 || a==0)
        return 1;
    return a*fact(a-1);
}
ll gcd(ll a,ll b)
{
    if(b==0)
        return a;
    return gcd(b,a%b);
}
ll sumdigit(ll n)
{
    ll sum=0;
    while(n)
    {
        sum+=n%10;
        n/=10;
    }
    return sum;
}
ll mvx[8]={1,1,1,0,0,-1,-1,-1};
ll mvy[8]={1,-1,0,-1,1,0,-1,1};
ll w=0;
//vector<ll>v;
//queue<ll>q;
ll n,m,k;
//ll x,sum=0,w=0;
//char ch1,ch2;
string s;
//bool flag=false;
//ll flag=-1;
//char ch[10001];
//vector<char>v;
//string f;
//ll sum=0;
//ll m,x;
ll t;
//ll ans=0,ans2=0;
ll minnnnnn=0;//minn=0;
ll maxx=0,maxxxxxxx=0,maxxx=0;
//ll ave=0;
//ll a,b;

bool flag=true;
ll ans1=0,ans3=0,ans2=0;
ll r,l;
//ll si[MAX],di[MAX];
//ll c,d;
//ll odd=0,even=0;
//vector<ll>p;

int main()
{
    set<char>st;
    cin>>s;
    rep(i,0,s.size())
    st.insert(s[i]);
    cout<<st.size()<<endl;
    return 0;
}

#include <bits/stdc++.h>
using namespace std;

int main()
{
    string s;
    cin>>s;

    int i,m,n,f=0,j;

    n=s.size();

    if(n%2==0)
    {
        m=n/2;
        for(i=0,j=m;i!=m;i++,j++)
        {
            if(s[i]!=s[j])
            {
                f=1;
                break;
            }
        }
    }
    int ans=0;
    for(i=1;i<n;i++)
    {
        if(s[i-1]==s[i])
            ans++;
    }
    if(ans==(n-1))
        f=2;

    if(f==1)
        cout<<n<<endl;
    else
    {
        if(f==2)
            cout<<1<<endl;
        else
            cout<<n/2<<endl;
    }
    return 0;
}

#define _CRT_SECURE_NO_WARNINGS
#include<bits/stdc++.h>
using namespace std;
#define IO std::ios::sync_with_stdio(false), cin.tie(NULL)
#define lp(i,n) for(int i = 0 ; i< int(n) ;++i)
#define lp2(i,j,n) for(int i =int(j) ; i< int(n) ;++i)
#define OO 2147483647
#define MOD 1000000007
#define tr(container, it) for(typeof(container.begin()) it = container.begin(); it != container.end(); it++)
#define all(c) c.begin(), c.end()
#define FindLog(container, element) (container.find(element) != container.end())
#define Find(container, element) (find(all(container),element) != container.end())
#define clr(arr,val) memset(arr,val,sizeof(arr))
#define odd(n)  ((n&1) == 1)
#define even(n) !(odd(n))
#define PI 3.1415926536
#define sp system("pause")
#define mp(x,y) make_pair(x,y)
#define MASK(size) bitset<size>
#define scint(var) scanf("%d",&var)
#define scll(var) scanf("%I64d",&var)
#define scst(var) scanf("%s",var)
typedef long long ll;
typedef unsigned long ul;
typedef unsigned long long ull;
typedef long double ld;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vi > vvi;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
ll gcd(ll a, ll b)
{
	return (b == 0 ? a : gcd(b, a % b));
}
ll lcm(ll a, ll b)
{
	return (a * (b / gcd(a, b)));
}
bool getbit(int num, int idx)//(0-->n-1)
{
	return (num >> idx & 1) == 1;
}
int setbit(int num, int idx, bool val)//idx(0-->n-1)
{
	if (val == true)
		return (num | (1 << idx));
	return num & ~(1 << idx);
}
int flipbit(int num, int idx)//idx(0-->n-1)
{
	return num ^ (1 << idx);
}
int cntbits(int mask)//O(bits count)
{
	int res = 0;
	while (mask)
		mask &= (mask - 1), res++;
	return res;
}

int main()
{
	int n;
	string s;
	cin >> n >> s;
	set<char>sol;
	lp(i, s.length())
		sol.insert(s[i]);
	cout << sol.size() << endl;
	return 0;
}

#include <bits/stdc++.h>
using namespace std;

int main() {
	char a[100],flag=1,flag1=0;
	cin>>a;
	for(int i=0;i<strlen(a);i++){
	    if(a[0]!=a[i]){
	        flag=0;
	        break;
	    }
	}
	if(flag){
	    flag1=2;
	    cout<<"1";
	}else{
	   for(int i=0;i<strlen(a)/2;i++){
	       if(i>=1){
	           char b[26];
	           char c[26];
	           int j,k,l,count=0,flag=1,m,n;
	           for(j=0;j<=i;j++){
	               b[j]=a[j];
	           }
	           b[j]='\0';
	       	   for(j=i+1,l=0,k=i;k>=0&&a[j]!='\0';k--,l++,j++){
	              c[l]=a[j];
	           }
	           c[l]='\0';
	           if(strcmp(b,c)==0){
	               cout<<c<<" "<<b<<endl;
	               count++;
	               if(strlen(b)+strlen(c)==strlen(a)){
	                   flag=0;
	                   flag1=2;
	                   cout<<strlen(b);
	                   i=strlen(a);
	                   break;
	               }
	               while(flag){
	                   for(l=0,j=j,k=i;k>=0&&a[j]!='\0';k--,l++,j++){
	                       c[l]=a[j];
	                   }
	                   c[l]='\0';
	                   if(strcmp(b,c)!=0){
	                       flag=0;
	                   }
	                   if(a[j]=='\0'&&flag==1){
	                       cout<<c;
	                       cout<<strlen(c);
	                       flag1=2;
	                       break;
	                   }
	               }

	           }
	       }
	   }
	}
	if(flag1!=2){
    cout<<strlen(a);
	  }
	return 0;
}

#include <bits/stdc++.h>
#define per pair<int,int>
#define f first
#define s second
#define pb push_back
#define mp make_pair
using namespace std;

int main()

{
    #ifndef ONLINE_JUDGE
    freopen("in","r",stdin);
    freopen("out","w",stdout);
    #endif // ONLINE_JUDGE
    char s[100005];
    int ret = 0;
    gets(s+1);
    int ap[100005];
int len = strlen(s+1);
    for (int i = 1; i<=len; ++i)
    {
        if (ap[int(s[i])]==0)
            ++ret,ap[int(s[i])] = 1;
    }
    printf("%d\n",ret);

    return 0;
}

#include <bits/stdc++.h>
using namespace std;

int main() {
	string s;
	cin>>s;
	int i,n,f=0;
	n=s.length();
	for(i=0;i<n-1;i++)
	{
	 if(s[i]!=s[i+1]){
	 f=1;
	 break;
	 }
	}
	if(f==0)
	cout<<1;
	else if(n%2==0){
	int g=0;
	for(i=0;i<n/2;i++){
		if(s[i]!=s[n/2+i]){
			g=1;
			break;
		}
	}
	if(g==0)
	cout<<n/2;
	else
	cout<<n;
	}
	else
	cout<<n;
	// your code goes here
	return 0;
}

#include <bits/stdc++.h>
using namespace std;
int main()
{
  int n,cnt=1,i;
  string s,t;
  cin>>s;
  n=s.length();
  sort(s.begin(),s.end());
    for(i=0;i<n-1;i++)
    {
        if(s[i]!=s[i+1])
        {
            cnt++;
        }
    }
    cout<<cnt<<endl;
}

 /*
Often you wake up by nocturnal emissions
But you feel no pleasure, no real satisfaction
Dreams mislead you with blanishment
You can't spend it on sweets or touch it, my friend

They divide you for yourself pollution
Have a hard-on for yourself and your bad illusions
Proceed to action with a snatch to crawl
You know you have to do it now

You consider your obnoxious misdeeds
Get a kick out of fruits you would like to greed
A place of joy, put yourself out of misery
A one night stand for the sake of variety

A vaginal victim, unable to resist
Discover your ass sweep off your feet
Don't hink twice and jump at the chance
Don't harass yourself, screw for deliverance

Abuse
*/
//  :::::::::::::::faraday_anshul:::::::::::::::::                      //
//  Indian Institute Of Information Technology and Management,Gwalior.  //
#include<bits/stdc++.h>
#define FIO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define T() int t; cin>>t; while(t--)
#define rep(i,start,lim) for(long long i=start;i<lim;i++)
#define rep1(i,start,lim) for(long long i=start;i<=lim;i++)
#define repd(i,start,lim) for(long long i=start;i>=lim;i--)
#define scan(x) scanf("%lld",&x)
#define print(x) printf("%lld ",x)
#define sz(a) lld((a).size())
#define eb emplace_back
#define pb push_back
#define mp make_pair
#define f first
#define s second
#define YES printf("YES\n")
#define NO printf("NO\n")
#define all(c) (c).begin(),(c).end()
#define present(c,x) ((c).find(x) != (c).end())
#define cpresent(c,x) (find(all(c),x) != (c).end())
#define tr(it,c) for(__typeof(c.begin()) it = c.begin(); it!=c.end(); ++it)
#define br printf("\n")
#define checkbit(n,b) ((n>>b)&1)
#define TRACE
#ifdef TRACE
#define trace1(x)                cerr<<#x<<": "<<x<<endl
#define trace2(x, y)             cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define trace3(x, y, z)          cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define trace4(a, b, c, d)       cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl
#define trace5(a, b, c, d, e)    cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<endl
#define trace6(a, b, c, d, e, f) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<" | "<<#f<<": "<<f<<endl
#else
#define trace1(x)                printf("")
#define trace2(x, y)             printf("")
#define trace3(x, y, z)          printf("")
#define trace4(a, b, c, d)       printf("")
#define trace5(a, b, c, d, e)    printf("")
#define trace6(a, b, c, d, e, f) printf("")
#endif
#define MAX 100005
#define LIMIT       262950
#define INF         1011111111
#define LLINF       1000111000111000111LL
#define EPS         (double)1e-10
#define MOD         1000000007
#define PI          3.14159265358979323
using namespace std;
typedef long double ldb;
typedef long long lld;
typedef unsigned long long ulld;
lld powm(lld base,lld exp,lld mod=MOD) {lld ans=1;while(exp){if(exp&1) ans=(ans*base)%mod;exp>>=1,base=(base*base)%mod;}return ans;}
inline bool ispalin(string s) { for(int i=0,j=s.size()-1;i<=j;i++,j--) if(s[i]!=s[j]) return false; return true; }
typedef vector<lld> vlld;
typedef pair<lld,lld> plld;
typedef map<lld,lld> mlld;
typedef set<lld> slld;
inline lld lcm(lld a,lld b){ return (a/__gcd(a, b))*b; }
template<typename T1, typename T2> inline pair<T1, T2> operator+(const pair<T1, T2> &p1 , const pair<T1, T2> &p2) { return pair<T1, T2>(p1.first + p2.first, p1.second + p2.second); }
template<typename T1, typename T2> inline pair<T1, T2> operator-(const pair<T1, T2> &p1 , const pair<T1, T2> &p2) { return pair<T1, T2>(p1.first - p2.first, p1.second - p2.second); }
#define DA(a,n) cout<<#a<<"=[ "; printarray(a,n); cout<<"]\n"
#define DAR(a,n,s) cout<<#a<<"["<<s<<"-"<<n-1<<"]=[ "; printarray(a,n,s); cout<<"]\n"
template<typename T, typename T2>void printarray(T a[], T2 sz, T2 beg = 0){ for (T2 i = beg; i<sz; i++) cout << a[i] << " "; }
///******Lets start coding :-) *******//
#define N 1005
int main()
{
	FIO
	lld n,a,b,c,kik,needed;
	cin>>n>>a>>b>>c;
	kik=n/4;
	needed=(kik+1)*4-n;
	//trace1(needed);
	if(needed==4)
	cout<<"0"<<endl;
	else if(needed==1)
	cout<<a<<endl;
	else if(needed==2)
	{
		if(2*a>b)
		cout<<b<<endl;
		else
		cout<<2*a<<endl;
	}
	else if(needed==3)
	{
		if(3*a>c)
		cout<<c<<endl;
		else
		cout<<3*a<<endl;
	}
}

#include <bits/stdc++.h>
#define maxn (int)(1e4)
#define sf scanf
#define pf printf
using namespace std;
//int deg[maxn+10];
int main() {
	// your code goes here
	int n,deg,sum;
	char s[100];
	set<char>S;
	int freq[26] = {0};
	sf("%s",s);
	int len = strlen(s);
	for(int i=0;i<len;i++)
	{
	    S.insert(s[i]);
	}
	pf("%d\n",S.size());
	fflush(stdout);
	return 0;
}

#include <bits/stdc++.h>

using namespace std;

#define pb push_back
#define ff first
#define ss second

typedef long long ll;
const ll MAXN = 2e6 + 10, inf = 1e18, mod = 1e9 + 7;

ll n;
string s;
set <char> se;

void Read_input() {
	cin >> n >> s;
	for (auto i : s)	se.insert(i);
}

void Solve() {
	cout << se.size();
}

int main() {

	ios_base::sync_with_stdio(false);	cin.tie(0);	cout.tie(0);
	//freopen("input.txt", "r", stdin),	freopen("output.txt", "w", stdout);

	Read_input(),	Solve();
	return 0;
}

#include<cstdio>
#include<cstring>
#include<cmath>
#include<iostream>
#include<algorithm>
using namespace std;
char op[50];
int num[26];
int main(){
    while(~scanf("%s",op)){
        memset(num,0,sizeof(num));
        for(int i=0;i<strlen(op);i++){
            if(!num[op[i]-'a'])
                num[op[i]-'a']++;
        }
        int cnt=0;
        for(int i=0;i<26;i++){
            if(num[i])
                cnt++;
        }
        cout<<cnt<<endl;
    }
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;

int main()
{
    ll n,i,j,k,a,b,c,d,e;
    string s,s1,nw="";
    cin>>s;
    s1=s;
    set<string>st;
    char x;
    for(i=0;i<s.size();i++)
    {
       nw+=(s[s.size()-1]+s.substr(0,s.size()-1));
       st.insert(nw);
    }
    cout<<st.size()<<endl;
    return 0;
}

#include <bits/stdc++.h>
using namespace std;

string rr(string& s)
{
  int n=s.size();
  for(int i=0;i<n;i++)
  {
    char c=s[i];
    for(int j=i+1;j<n;j++)
    {
      if(c=s[j])
        s.erase(remove(s.begin()+j,s.end(),s[j]),s.end());}}
  return s;
}

int main()
{string s,s2;
cin>>s;
s=rr(s);
cout<<s.size();
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
map <int, int> mp;
int main()
{
    int i, j, k, n, m, t, p, cas=1;
    char arr[101];
    scanf("%s", arr);
    m=0;
    p=strlen(arr);
    for( i=0; i<p; i++)
    {
        mp[arr[i]-'a']++;
        //aprintf("%d ", arr[i]-'a');
    }
    for( i=0; i<26; i++)
    {
        if(mp[i]>=1)
        {
            m++;
        }
    }
    printf("%d\n", m);
    return 0;
}

#include <stdio.h>
#include <string.h>

int main(){
char str[105];
int ans[30] = {0};
scanf("%s", str);
int ctr = 0;
int flag = 0;
int x = 0;
for(int i = 0; i < strlen(str);i++){
	if(str[i] != str[0]){
	 flag = 1;
	}
}
if(flag == 0){
	printf("1");
	return 0;
}
int leng = strlen(str)/2;
while(leng >= 2){
if(strlen(str) % leng != 0){
	leng--;
	continue;
}
	if(str[x] == str[x + leng]){
		ctr++;
		if(ctr == strlen(str) - leng){
			printf("%d", leng);
			return 0;
		}
		x++;
	}else{
		x = 0;
		ctr = 0;
		leng--;
	}
}
printf("%d", strlen(str));
return 0;
}

#include <stdio.h>
#include <string.h>

int main(){
	char s[55];
	int a,b;
	scanf("%s",s);
	a=strlen(s);
	b=1;
	for(int i=1;i<a;i++){
		if(s[i]!=s[0]){
			b++;
		}
		if(s[i]==s[0]) {
			i=a;
		}
	}
	if(a%b==0){
		printf("%d",b);
	}
	if(a%b!=0){
		printf("%d",a);
	}
	return 0;
}

#include <set>
#include <cstring>
#include <algorithm>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <queue>
#include <stack>
#include <vector>

#define  mp make_pair
#define pb push_back
#define  X first
#define  Y second

using namespace std;
typedef long long LL;
const int maxn = 505;
int n, m;
char s[maxn];
void init() {
    cin >> s;
    n = strlen(s);
    for(int i = 1; i <= n; i++) {
        bool flag = 0;
        for(int j = 0; j < n; j++) {
            if(s[j] != s[j % i]){
                flag = 1;
                break;
            }
        }
        if(!flag) {
            cout<<i<<endl;
            break;
        }
    }
}

int main() {
#ifdef LOCAL
    freopen("in.txt", "r", stdin);
#endif // LOCAL
    init();
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long n,m,i;
    string s;
    set<char>st;

    cin>>s;

    n=s.length();

    for(i=0;i<n;i++)
    {
        st.insert(s[i]);
    }

    m=st.size();

    cout<<m<<endl;

   //main();
}

#include <iostream>
#include <algorithm>
#include <cctype>
#include <string.h>
#include <string>
#include <sstream>
#include <math.h>
#include <set>

using namespace std;

int main ()
{
    string s1;
    cin>>s1;
    set<char> ch;
    for(int i=0 ; i<s1.length();i++)
    {
        ch.insert(s1[i]);
    }

    cout<<ch.size();
}

#define _CRT_SECURE_NO_WARNINGS
#include<bits/stdc++.h>
using namespace std;
#define IO std::ios::sync_with_stdio(false), cin.tie(NULL)
#define lp(i,n) for(int i = 0 ; i< int(n) ;++i)
#define lp2(i,j,n) for(int i =int(j) ; i< int(n) ;++i)
#define OO 2147483647
#define MOD 1000000007
#define tr(container, it) for(typeof(container.begin()) it = container.begin(); it != container.end(); it++)
#define all(c) c.begin(), c.end()
#define FindLog(container, element) (container.find(element) != container.end())
#define Find(container, element) (find(all(container),element) != container.end())
#define clr(arr,val) memset(arr,val,sizeof(arr))
#define odd(n)  ((n&1) == 1)
#define even(n) !(odd(n))
#define PI 3.1415926536
#define sp system("pause")
#define mp(x,y) make_pair(x,y)
#define MASK(size) bitset<size>
#define scint(var) scanf("%d",&var)
#define scll(var) scanf("%I64d",&var)
#define scst(var) scanf("%s",var)
typedef long long ll;
typedef unsigned long ul;
typedef unsigned long long ull;
typedef long double ld;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vi > vvi;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
ll gcd(ll a, ll b)
{
	return (b == 0 ? a : gcd(b, a % b));
}
ll lcm(ll a, ll b)
{
	return (a * (b / gcd(a, b)));
}
bool getbit(int num, int idx)//(0-->n-1)
{
	return (num >> idx & 1) == 1;
}
int setbit(int num, int idx, bool val)//idx(0-->n-1)
{
	if (val == true)
		return (num | (1 << idx));
	return num & ~(1 << idx);
}
int flipbit(int num, int idx)//idx(0-->n-1)
{
	return num ^ (1 << idx);
}
int cntbits(int mask)//O(bits count)
{
	int res = 0;
	while (mask)
		mask &= (mask - 1), res++;
	return res;
}

int main()
{
	string s;
	cin >> s;
	set<char>sol;
	lp(i, s.length())
		sol.insert(s[i]);
	cout << sol.size() << endl;
	return 0;
}

#include <bits/stdc++.h>
using namespace std;

#define ifthen(x, y, z) (x ? y: z)
#define mp make_pair
#define mt make_tuple

const int INF = 1e9 + 1;

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    string s;
    cin >> s;
    vector<int> pi(52);
    int n = s.length();
    int j;
    int mx = 0;
    for (int i = 1; i < n; ++i) {
        j = pi[i-1];
        while(j > 0 && s[i]!=s[j])
            j = pi[j-1];
        if (s[j]==s[i])
            ++j;
        pi[i]=j;
    }
    int last_zero_pos = -1;
    for (int i = 0; i < n; ++i)
        if (pi[i] == 0)
            last_zero_pos = i;
    int cycle = n-pi[n-1];
    cerr << cycle << ' ' << last_zero_pos << '\n';
    if (last_zero_pos+1 == cycle)
        cout << cycle << endl;
    else
        cout << n << endl;
    return 0;
}

#include<bits/stdc++.h>
#define N 1000
#define TIME ios_base::sync_with_stdio(0)
#define ll long long
#define N 1000005
using namespace std ;
string a;
set<string> x;
int main () {
        TIME;

        cin>>a;
        for(ll i=1; i<=a.size(); i++){
        for(ll j=1; j<=a.size(); j++){
                swap (a[j],a[j+1]);
                        }
                x.insert(a);
        }

        cout<<x.size();
}

#include <iostream>
#include<string.h>
using namespace std;

int main() {
	// your code goes here
	char s[55];
	cin>>s;
	int l=strlen(s);
	int i,j=1;
	for(i=0;i<l&&j<l;)
	{
		if(s[i]!=s[j])
		{
			j++;
			i=0;
		}
		else
		{
			i++;
			j++;
		}

	}
	cout<<j-i;
	return 0;
}