XiYue likes watching the white moon. Under the moonlight, each star has its own beauty. The same thing holds for strings.
For a string
s with length
n, p is a
period of
n if it satisfies
p∣n and
si=si+p,∀0≤i<n−p.
For a string
s, define its
beauty f(s) as the sum of its periods.
For example, aaaa has periods 1,2,4, so it has beauty f(aaaa)=7, aba has only one period 3, so f(aba)=3.
Now, given a string s consisting of lowercase English letters, you need to calculate ∑0≤l≤r<∣s∣f(sl,r), i.e., the sum of beauty over all substrings of s.