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
#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<cstdlib>
using namespace std;
inline int read()
{
    int x=0,f=1;char ch=getchar();
    while(ch<'0' || ch>'9'){if(ch=='-')f=-1;ch=getchar();}
    while(ch>='0' && ch<='9')x=x*10+ch-'0',ch=getchar();
    return x*f;
}
int stack[20];
inline void write(int x)
{
	if(x<0){putchar('-');x=-x;}
    if(!x){putchar('0');return;}
    int top=0;
    while(x)stack[++top]=x%10,x/=10;
    while(top)putchar(stack[top--]+'0');
}
inline void pr1(int x){write(x),putchar(' ');}
inline void pr2(int x){write(x),puts("");}
const int mod=998244353;
inline int ad(int x){return x>=mod?x-mod:x;}
inline int dec(int x){return x<0?x+mod:x;}
char ss[200010];
int n,top,sta[110],f[110];
inline bool pd(int x)
{
	for(int i=1;i<=n;i++)
	{
		int p=i%x,uf=i/x;if(!p)p=x,uf++;
		if(((uf&1)^(ss[p]-'0'))>(ss[i]-'0'))return false;
		if(((uf&1)^(ss[p]-'0'))<(ss[i]-'0'))return true;
	}
	return true;
}
int main()
{
    //freopen("a.in","r",stdin);
	//freopen("a.out","w",stdout);
	n=read();
	scanf("%s",ss+1);
	for(int i=1;i<=n;i++)if(n%i==0 && (n/i)&1)sta[++top]=i,f[top]=i;
	for(int i=top;i>=1;i--)
	{
		for(int j=i+1;j<=top;j++)if(sta[j]%sta[i]==0 && (sta[j]/sta[i])&1)f[i]=dec(f[i]-f[j]);
	}
	int ans=0;
	for(int i=1;i<=top;i++)
	{
		int now=0;
		for(int j=1;j<=sta[i];j++)now=ad((now<<1)+ss[j]-'0');
		if(pd(sta[i])==true)now++;
		ans=ad(ans+1LL*f[i]*now%mod);
	}pr2(ad(ans<<1));
	return 0;
}