import sys,collections sys.setrecursionlimit(10**7) mod = 10**9+7 s= input() d = collections.defaultdict(lambda: 0) def DFS(s,n): if s in d: return d[s] for i in range(1,len(s)//2+1): if s[:i] == s[-i:]: d[s] += DFS(s[i:-i],n)%mod d[s] += 1 return 1 n = 1 ans = DFS(s,n) print(d[s]+1)