#include<bits/stdc++.h>
#define Tp template<typename Ty>
#define Ts template<typename Ty,typename... Ar>
#define Reg register
#define RI Reg int
#define Con const
#define CI Con int&
#define I inline
#define W while
#define N 300
#define X 998244353
#define Inc(x,y) ((x+=(y))>=X&&(x-=X))
using namespace std;
int n,f[N+5][N+5][N+5],g[N+5][N+5][N+5];char s[N+5];
int main()
{
	RI i,j,k;scanf("%s",s+1),n=strlen(s+1);
	for(f[n][0][0]=1,i=n;i;--i) for(j=n-i;~j;--j) for(k=n-i-j;~k;--k)
		Inc(f[i-1][j][k],f[i][j][k]),Inc(f[i-1][j+(s[i+j+k]^48)][k+(s[i+j+k]^49)],f[i][j][k]);
	for(g[1][0][0]=1,i=1;i<=n;++i) for(j=i;~j;--j) for(k=i-j;~k;--k) g[i][j][k]&&
	(
		g[i+1][j][k]=1,i^n&&(g[i+2][j+(s[i]^49)][k+(s[i]^48)]=g[i+2][j+(s[i+1]^49)][k+(s[i+1]^48)]=1),
		j&&(g[i+1][j-1+(s[i]^49)][k+(s[i]^48)]=1),k&&(g[i+1][j+(s[i]^49)][k-1+(s[i]^48)]=1)
	);
	RI t=0;for(i=0;i^n;++i) for(j=n-i;~j;--j) for(k=n-i-j;~k;--k) g[i+j+k+1][j][k]&&Inc(t,f[i][j][k]);
	return printf("%d\n",t),0;
}
### Prompt

Your task is to create a Cpp solution to the following problem:

Given is a string S consisting of `0` and `1`. Find the number of strings, modulo 998244353, that can result from applying the following operation on S zero or more times:

* Remove the two characters at the beginning of S, erase one of them, and reinsert the other somewhere in S. This operation can be applied only when S has two or more characters.

Constraints

* 1 \leq |S| \leq 300
* S consists of `0` and `1`.

Input

Input is given from Standard Input in the following format:


S


Output

Print the number of strings, modulo 998244353, that can result from applying the operation on S zero or more times.

Examples

Input

0001


Output

8


Input

110001


Output

24


Input

11101111011111000000000110000001111100011111000000001111111110000000111111111


Output

697354558

### Response

```cpp
#include<bits/stdc++.h>
#define Tp template<typename Ty>
#define Ts template<typename Ty,typename... Ar>
#define Reg register
#define RI Reg int
#define Con const
#define CI Con int&
#define I inline
#define W while
#define N 300
#define X 998244353
#define Inc(x,y) ((x+=(y))>=X&&(x-=X))
using namespace std;
int n,f[N+5][N+5][N+5],g[N+5][N+5][N+5];char s[N+5];
int main()
{
	RI i,j,k;scanf("%s",s+1),n=strlen(s+1);
	for(f[n][0][0]=1,i=n;i;--i) for(j=n-i;~j;--j) for(k=n-i-j;~k;--k)
		Inc(f[i-1][j][k],f[i][j][k]),Inc(f[i-1][j+(s[i+j+k]^48)][k+(s[i+j+k]^49)],f[i][j][k]);
	for(g[1][0][0]=1,i=1;i<=n;++i) for(j=i;~j;--j) for(k=i-j;~k;--k) g[i][j][k]&&
	(
		g[i+1][j][k]=1,i^n&&(g[i+2][j+(s[i]^49)][k+(s[i]^48)]=g[i+2][j+(s[i+1]^49)][k+(s[i+1]^48)]=1),
		j&&(g[i+1][j-1+(s[i]^49)][k+(s[i]^48)]=1),k&&(g[i+1][j+(s[i]^49)][k-1+(s[i]^48)]=1)
	);
	RI t=0;for(i=0;i^n;++i) for(j=n-i;~j;--j) for(k=n-i-j;~k;--k) g[i+j+k+1][j][k]&&Inc(t,f[i][j][k]);
	return printf("%d\n",t),0;
}
```