Problem: 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.

Input

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

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.

Examples

Input

abcd


Output

4


Input

bbb


Output

1


Input

yzyz


Output

2

Note

For 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".

Solution (in JAVA):

Solution:


import java.io.*;
import java.util.*;


public class Solution 
{
	
	InputStream is;
	PrintWriter out;
	
	String OUTPUT = "7";
	String POUTPUT = "";
	String INPUT = "abba";
	 
	
	void solve()
	{
		char arr[] = ns().toCharArray();
		int n = arr.length;
		HashSet<String> hash = new HashSet<String>();
		int count =1000;
		while(count!=0)
		{
		    char ch = arr[n-1];
		    for(int i=n-1;i>0;i--)
		    {
		    	arr[i] = arr[i-1];
		    }
		    arr[0] = ch;
//		    System.out.println(arr);
		    hash.add(new String(arr));
		    count--;
		}
		System.out.println(hash.size());
	}
		
	
	
	void run() throws Exception
	{
//		is = oj ? System.in : new ByteArrayInputStream(INPUT.getBytes());
		is = System.in;
		out = new PrintWriter(System.out);
		
		long s = System.currentTimeMillis();
		solve();
		out.flush();
//		tr(System.currentTimeMillis()-s+"ms");
	}
	
	
	private static class BS {
        //  Binary search
        private static int binarySearch(int[] arr, int ele) {
            int low = 0;
            int high = arr.length - 1;
            while (low <= high) {
                int mid = (low + high) / 2;
                if (arr[mid] == ele) {
                    return mid;
                } else if (ele < arr[mid]) {
                    high = mid - 1;
                } else {
                    low = mid + 1;
                }
            }
            return -1;
        }

        //    First occurence using binary search
        private static int binarySearchFirstOccurence(int[] arr, int ele) {
            int low = 0;
            int high = arr.length - 1;
            int ans = -1;
            while (low <= high) {
                int mid = (low + high) / 2;
                if (arr[mid] == ele) {
                    ans = mid;
                    high = mid - 1;
                } else if (ele < arr[mid]) {
                    high = mid - 1;
                } else {
                    low = mid + 1;
                }
            }
            return ans;
        }


        //    Last occurenece using binary search
        private static int binarySearchLastOccurence(int[] arr, int ele) 
        {
            int low = 0;
            int high = arr.length - 1;
            int ans = -1;
            while (low <= high) {
                int mid = (low + high) / 2;
                if (arr[mid] == ele) {
                    ans = mid;
                    low = mid + 1;
                } else if (ele < arr[mid]) {
                    high = mid - 1;
                } else {
                    low = mid + 1;
                }
            }
            return ans;
        }
        
        
        //just smaller or equal element using binary search
        static int binarySearchCountSmaller(int arr[], int key)  
        { 
        	int n  = arr.length;
            int left = 0, right = n; 
          
            int mid = 0; 
            while (left < right) { 
            mid = (right + left) >> 1; 
          
            if (arr[mid] == key) { 
                  
                while (mid+1<n && arr[mid + 1] == key) 
                mid++; 
                break; 
            } 
            else if (arr[mid] > key) 
                right = mid; 
          
            else
                left = mid + 1; 
            } 
            while (mid > - 1 && arr[mid] > key) 
            mid--; 
          
            return mid + 1; 
        } 
        
//        just greater or equal element using binary search
        static int ceilSearch(int arr[], int low, int high, int x, boolean visited[]) 
        { 
          int i;     
           
          if(x <= arr[low]) 
            return low;   
          for(i = low; i < high; i++) 
          { 
            if(arr[i] == x && visited[i] == true) 
              return i; 
           
            if(arr[i] < x && arr[i+1] >= x) 
               return i+1; 
          }          
           
          return -1; 
        } 
        
        
    }
	public static void main(String[] args) throws Exception { new Solution().run(); }
	
	private byte[] inbuf = new byte[1024];
	public int lenbuf = 0, ptrbuf = 0;
	
	private int readByte()
	{
		if(lenbuf == -1)throw new InputMismatchException();
		if(ptrbuf >= lenbuf){
			ptrbuf = 0;
			try { lenbuf = is.read(inbuf); } catch (IOException e) { throw new InputMismatchException(); }
			if(lenbuf <= 0)return -1;
		}
		return inbuf[ptrbuf++];
	}
	
	private boolean isSpaceChar(int c) { return !(c >= 33 && c <= 126); }
	private int skip() { int b; while((b = readByte()) != -1 && isSpaceChar(b)); return b; }
	
	private double nd() { return Double.parseDouble(ns()); }
	private char nc() { return (char)skip(); }
	
	private String ns()
	{
		int b = skip();
		StringBuilder sb = new StringBuilder();
		while(!(isSpaceChar(b))){ // when nextLine, (isSpaceChar(b) && b != ' ')
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	}
	
	private char[] ns(int n)
	{
		char[] buf = new char[n];
		int b = skip(), p = 0;
		while(p < n && !(isSpaceChar(b))){
			buf[p++] = (char)b;
			b = readByte();
		}
		return n == p ? buf : Arrays.copyOf(buf, p);
	}
	
	private char[][] nm(int n, int m)
	{
		char[][] map = new char[n][];
		for(int i = 0;i < n;i++)map[i] = ns(m);
		return map;
	}
	
	private int[] na(int n)
	{
		int[] a = new int[n];
		for(int i = 0;i < n;i++)a[i] = ni();
		return a;
	}
	
	private long[] nla(int n)
	{
		long[] a = new long[n];
		for(int i = 0;i < n;i++)a[i] = nl();
		return a;
	}
	private int ni()
	{
		int num = 0, b;
		boolean minus = false;
		while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
		if(b == '-'){
			minus = true;
			b = readByte();
		}
		
		while(true){
			if(b >= '0' && b <= '9'){
				num = num * 10 + (b - '0');
			}else{
				return minus ? -num : num;
			}
			b = readByte();
		}
	}
	
	private long nl()
	{
		long num = 0;
		int b;
		boolean minus = false;
		while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
		if(b == '-'){
			minus = true;
			b = readByte();
		}
		
		while(true){
			if(b >= '0' && b <= '9'){
				num = num * 10 + (b - '0');
			}else{
				return minus ? -num : num;
			}
			b = readByte();
		}
	}
	
	private boolean oj = System.getProperty("ONLINE_JUDGE") != null;
	private void tr(Object... o) 
	{
		if(!oj)
		{
			System.out.println(Arrays.deepToString(o)); 
			if(POUTPUT.equals(OUTPUT))
			{
				System.out.print("Verdict OK");
			}
			else
			{
				System.out.println("Wrong Answer");
				System.out.println("Participant's Output : " + POUTPUT);
				System.out.println("Jury's Answer : " + OUTPUT);
			}
		}
	}

}