#include<bits/stdc++.h>
using namespace std;

const int maxn=305;
const int mod=998244353;
int n,ans;
char s[maxn];
bool f[maxn][maxn][maxn];
int g[maxn][maxn][maxn],suf[maxn];

void Add(int &a,int b){
	a+=b;
	if(a>=mod)a-=mod;
}

int main(){
	scanf("%s",s);n=strlen(s);
	f[0][0][0]=true;
	for(int i=0;i<n;i++)for(int j=n;j>=0;j--)for(int k=n;k>=0;k--)if(f[i][j][k]){
		if(i+1<n){
			if(s[i]=='0'||s[i+1]=='0')f[i+2][j+1][k]=true;
			if(s[i]=='1'||s[i+1]=='1')f[i+2][j][k+1]=true;
		}
		if(j+k>=2){
			if(j)f[i][j-1][k]=true;
			if(k)f[i][j][k-1]=true;
		}
		if(j+k>=1){
			f[i+1][j][k]=true;
			if(s[i]=='0'&&k)f[i+1][j+1][k-1]=true;
			if(s[i]=='1'&&j)f[i+1][j-1][k+1]=true;
		}
	}
	g[0][0][n]=1;
	for(int j=0;j<=n;j++)for(int k=0;k<=n;k++)for(int i=n;i>=0;i--)if(g[j][k][i]){
		Add(g[j+1][k][i-(i>0&&s[i-1]=='0')],g[j][k][i]);
		Add(g[j][k+1][i-(i>0&&s[i-1]=='1')],g[j][k][i]);
	}
	suf[n]=0;
	for(int i=n-1;i>=0;i--)suf[i]=suf[i+1]+(s[i]=='1');
	for(int j=0;j<=n;j++)for(int k=0;k<=n;k++){
		for(int i=0;i<=n;i++){
			int cj=j-(n-i-suf[i]),ck=k-suf[i];
			if(cj>=0&&ck>=0&&(f[i][cj][ck]||(i<n&&f[i][cj+1][ck])||(i<n&&f[i][cj][ck+1])||(i==1&&i<n&&cj==0&&ck==0)))
				Add(ans,g[j][k][i]);
		}
	}
	printf("%d\n",ans);
	return 0;
}