//Let's join Kaede Takagaki Fan Club !!
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target ("avx")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<int,P> P1;
typedef pair<P,P> P2;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 1000000000
#define fi first
#define sc second
#define rep(i,x) for(int i=0;i<x;i++)
#define repn(i,x) for(int i=1;i<=x;i++)
#define SORT(x) sort(x.begin(),x.end())
#define ERASE(x) x.erase(unique(x.begin(),x.end()),x.end())
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin())
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin())
#define all(x) x.begin(),x.end()
template<class T>
void dmp(T a){
	rep(i,a.size()) cout << a[i] << " ";
	cout << endl;
}
template<class T>
bool chmax(T&a, T b){
	if(a < b){
		a = b;
		return 1;
	}
	return 0;
}
template<class T>
bool chmin(T&a, T b){
	if(a > b){
		a = b;
		return 1;
	}
	return 0;
}
template<class T>
void g(T &a){
	cin >> a;
}
template<class T>
void o(const T &a,bool space=false){
	cout << a << (space?' ':'\n');
}
//ios::sync_with_stdio(false);
const ll mod = 998244353;//998244353
template<class T>
void add(T&a,T b){
	a+=b;
	if(a >= mod) a-=mod;
}
bool valid[305][305][305];
int n;
string str;
P1 good[305][305];
ll way[305][305][305];
ll tate[305][305][305], yoko[305][305][305];
ll C[505][505];
int main(){
	rep(i, 503) rep(j, i+1){
		if(j == 0 || j == i) C[i][j] = 1;
		else C[i][j] = (C[i-1][j]+C[i-1][j-1])%mod;
	}
	cin >> str;
	n = str.size();
	valid[0][0][0] = 1;
	rep(i, n+1){
		for(int z=n;z>=0;z--){
			for(int o=n;o>=0;o--){
				if(valid[i][z][o] == false) continue;
				if(n-i >= 2){
					if(str[i] == '0' || str[i+1] == '0'){
						valid[i+2][z+1][o] = 1;
					}
					if(str[i] == '1' || str[i+1] == '1'){
						valid[i+2][z][o+1] = 1;
					}
				}
				if(n-i >= 1){
					if(z+o > 0) valid[i+1][z][o] = 1;
					if(str[i] == '0' && o > 0) valid[i+1][z+1][o-1] = 1;
					if(str[i] == '1' && z > 0) valid[i+1][z-1][o+1] = 1;
				}
				if(n-i >= 0){
					if(z+o >= 2 && z) valid[i][z-1][o] = 1;
					if(z+o >= 2 && o) valid[i][z][o-1] = 1;
				}
			}
		}
	}
	ll ans = 0;
	rep(i, 305)rep(j, 305) good[i][j] = mp(-1, mp(-1, -1));
	rep(i, n+1){
		int zn = 0, on = 0;
		for(int j=i;j<n;j++) (str[j]=='0'?zn:on)++;
		for(int z=0;z<=n;z++){
			for(int o=0;o<=n;o++){
				if(valid[i][z][o]) good[zn+z][on+o] = mp(i, mp(z, o));
			}
		}
	}
	way[0][0][0] = 1;
	for(int i=0;i<n;i++){
		for(int z=0;z<n;z++){
			for(int o=0;o<n;o++){
				if(z) add(tate[i][z][o], tate[i][z-1][o]);
				if(o) add(yoko[i][z][o], yoko[i][z][o-1]);
				way[i][z][o] += tate[i][z][o] + yoko[i][z][o];
				if(way[i][z][o] >= mod) way[i][z][o]%=mod;
				if(way[i][z][o] == 0) continue;
				bool isz = (str[n-1-i]=='0');
              	//cout<<i<<z<<o<<" "<<way[i][z][o]<<endl;
				if(isz) yoko[i+1][z][o] += way[i][z][o];
				else tate[i+1][z][o] += way[i][z][o];
			}
		}
	}
	rep(z, n+1) rep(o, n+1){
		if(good[z][o].fi == -1) continue;
		int len = n - good[z][o].fi;
		int adz = good[z][o].sc.fi;
		int ado = good[z][o].sc.sc;
		rep(i, adz+1) rep(j, ado+1) ans += way[len][i][j] * C[adz-i+ado-j][adz-i] % mod;
	}
	cout << (ans%mod+mod+1)%mod << endl;
}

Measured memory_bytes: 661764