Given are integers N and X. For each integer k between 0 and X (inclusive), find the answer to the following question, then compute the sum of all those answers, modulo 998244353.

* Let us repeat the following operation on the integer k. Operation: if the integer is currently odd, subtract 1 from it and divide it by 2; otherwise, divide it by 2 and add 2^{N-1} to it. How many operations need to be performed until k returns to its original value? (The answer is considered to be 0 if k never returns to its original value.)

Constraints

* 1 \leq N \leq 2\times 10^5
* 0 \leq X < 2^N
* X is given in binary and has exactly N digits. (In case X has less than N digits, it is given with leading zeroes.)
* All values in input are integers.

Input

Input is given from Standard Input in the following format:


N
X


Output

Print the sum of the answers to the questions for the integers between 0 and X (inclusive), modulo 998244353.

Examples

Input

3
111


Output

40


Input

6
110101


Output

616


Input

30
001110011011011101010111011100


Output

549320998
def main():
    md = 998244353
    n = int(input())
    x = input()
    dd = []
    for d0 in range(1, n + 1):
        if n % d0 == 0:
            d1 = n // d0
            if d0 % 2: dd += [d0]
            if d1 % 2: dd += [d1]
        if d0 ** 2 >= n: break
    if len(dd) > 1 and dd[-1] == dd[-2]:
        del dd[-1]
    dd.sort(reverse=True)
    pp = []
    ori = int(x, 2)
    for i, d in enumerate(dd):
        k = n // d
        a = x[:k]
        pp += [int(a, 2)]
        na = "".join("0" if c == "1" else "1" for c in a)
        cor = int((a + na) * (d // 2) + a, 2)
        if cor <= ori: pp[-1] += 1
        for j in range(i):
            dj = dd[j]
            if dj % d == 0:
                pp[i] -= pp[j]
    # print(dd)
    # print(pp)
    ans = 0
    for d, p in zip(dd, pp):
        k = n // d
        ans = (ans + 2 * k * p) % md
    print(ans)

main()
