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<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<vector>
#include<cmath>
#include<algorithm>
#include<map>
#include<queue>
#include<deque>
#include<iomanip>
#include<tuple>
using namespace std;
typedef long long int LL;
typedef pair<int,int> P;
typedef pair<LL,int> LP;
const int INF=1<<30;
const LL MAX=998244353;

void array_show(int *array,int array_n,char middle=' '){
	for(int i=0;i<array_n;i++)printf("%d%c",array[i],(i!=array_n-1?middle:'\n'));
}
void array_show(LL *array,int array_n,char middle=' '){
	for(int i=0;i<array_n;i++)printf("%lld%c",array[i],(i!=array_n-1?middle:'\n'));
}

string sa;
LL pp[200005];
LL num[200005];
int tes[200005];
int n,m;

int gcd(int a,int b){
	if(a<b)gcd(b,a);
	if(b==0)return a;
	return gcd(b,a%b);
}

LL check(int a){
	memset(tes,0,sizeof(tes));
	int i,j,k;
	LL b,c;
	LL s=0;
	for(i=0;i<a;i++){
		if(sa[i]=='0')continue;
		tes[i]=1;
		s+=pp[a-i-1];
		if(s>=MAX)s%=MAX;
	}
	bool flag=true;
	for(i=a;i<n;i++){
		tes[i]=1-tes[i-a];
		if(tes[i]==0 && sa[i]=='1')break;
		if(tes[i]==1 && sa[i]=='0'){
			flag=false;
			break;
		}
	}
	if(flag)s++;
	for(i=1;i<a;i++){
		if(a%i!=0)continue;
		s-=num[i];
		if(s<0)s+=MAX;
	}
	if(s>=MAX)s%=MAX;
	num[i]=s;
	return s;
}

int main(){
	LL i,j,k;
	LL a,b,c;
	LL s=0;
	cin>>n;
	cin>>sa;
	pp[0]=1;
	for(i=1;i<=n;i++){
		pp[i]=pp[i-1]*2;
		if(pp[i]>=MAX)pp[i]%=MAX;
	}
	for(i=1;i<=n;i++){
		if(n%i==0 && (n/i)%2==1){
			s+=check(i)*i*2;
			if(s>=MAX)s%=MAX;
		}
	}
	cout<<s<<endl;
}