#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;

template<class T> ostream& operator<<(ostream &os, vector<T> V) {
 os << "[ "; for(auto v : V) os << v << " "; return os << "]";}
template<class L, class R> ostream& operator<<(ostream &os, pair<L,R> P) {
	return os << "(" << P.first << "," << P.second << ")";}

#define TRACE
#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
	cout << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
	const char* comma = strchr(names + 1, ',');cout.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}
#else
#define trace(...) 1
#endif


#define ll long long
#define ld long double
#define vll vector<ll>
#define pll pair<ll,ll>
#define vpll vector<pll>
#define I insert 
#define pb push_back
#define F first
#define S second
#define endl "\n"
#define vi vector<int>
#define pii pair<int, int>
#define vpii vector< pii >


const int mod=998244353;
inline int mul(int a,int b){return (a*1ll*b)%mod;}
inline int add(int a,int b){a+=b;if(a>=mod)a-=mod;return a;}
inline int sub(int a,int b){a-=b;if(a<0)a+=mod;return a;}
inline int power(int a,int b){int rt=1;while(b>0){if(b&1)rt=mul(rt,a);a=mul(a,a);b>>=1;}return rt;}
inline int inv(int a){return power(a,mod-2);}
inline void modadd(int &a,int &b){a+=b;if(a>=mod)a-=mod;} 

const int M = 302;

int dp[M][M][M];
string s; 
int n;

int dp1[M][M][M];
int pos[2][M];


void pre(){
	for(int i=0;i<=n;i++){
		for(int j=0;j<=n;j++){
			for(int k=n;k>=0;k--){
				int &cur = dp[i][j][k];
				cur = 0 ;
				if(k==n && i==0 && j==0){ cur = 1; continue; }

				if(k==n){
					if(i>0) cur = add(cur, dp[i-1][j][k]);
					if(j>0) cur = add(cur, dp[i][j-1][k]);
					continue;
				}
				
				if(s[k]=='0'){
					if(i>0) cur = add(cur, dp[i-1][j][k+1]);
					if(j>0) cur = add(cur, dp[i][j-1][k]);
				}

				if(s[k]=='1'){
					if(i>0) cur = add(cur, dp[i-1][j][k]);
					if(j>0) cur = add(cur, dp[i][j-1][k+1]);
				}

				// trace(i, j, k, dp[i][j][k]);

			}
		}
	}

	pos[0][n] = pos[1][n] = 0;
	for(int i=n-1;i>=0;i--){
		pos[0][i] = pos[0][i+1];
		pos[1][i] = pos[1][i+1];
		if(s[i]=='0') pos[0][i]++;
		else pos[1][i]++;
	}


}

int mc[M][M];


int main(){
	ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);cout<<setprecision(25);
	cin>>s;
	n = s.length();
	pre();
	dp1[0][0][0] = 1;
	int ans = 0;

	for(int i=0;i<=n;i++){
		for(int j=0;j<=n;j++){
			mc[i][j] = -1;
		}
	}

	for(int rem=n;rem>=0;rem--){
		for(int i=0;i<=n;i++){
			for(int j=0;j<=n;j++){
				int k = rem - (i+j); if(k<0) continue;
				k = n - k;
				int i1 = i + pos[0][k];
				int j1 = j + pos[1][k];
				if(dp1[i][j][k]==0) continue;
				
			// for(int k=0;k<=n;k++){
				mc[i1][j1] = max(mc[i1][j1], k);


				// if(k==n){

				// 	if(i>0) dp1[i-1][j][k] = 1;
				// 	if(j>0) dp1[i][j-1][k] = 1;
				// 	continue;
				// }				

				if(i+j >= 2){
					if(i>0)dp1[i-1][j][k] = 1;
					if(j>0)dp1[i][j-1][k] = 1; 
				}

				if(k==n) continue;

				if(s[k]=='0'){
					if(i>0 || j>0) dp1[i][j][k+1] = 1;
					if(j>0) dp1[i+1][j-1][k+1] = 1;
					if(k!=n-1 && s[k+1]=='0'){
						dp1[i+1][j][k+2] = 1;
					}
					if(k!=n-1 && s[k+1]=='1'){
						dp1[i+1][j][k+2] = 1;
						dp1[i][j+1][k+2] = 1;
					}
				}
				if(s[k]=='1'){
					if(i>0) dp1[i-1][j+1][k+1] = 1;
					if(i>0 || j>0) dp1[i][j][k+1] = 1;
					if(k!=n-1 && s[k+1]=='1'){
						dp1[i][j+1][k+2] = 1;
					}
					if(k!=n-1 && s[k+1]=='0'){
						dp1[i+1][j][k+2] = 1;
						dp1[i][j+1][k+2] = 1;
					}
				}

			}
		}
	}


	// int ans = 0;
	for(int i=0;i<=n;i++){
		for(int j=0;j<=n-i;j++){
			if(mc[i][j]>=0 && i<=pos[0][0] && j<=pos[1][0]){
				ans = add(ans, dp[i][j][mc[i][j]]);
				// trace(i, j, mc[i][j], dp[i][j][mc[i][j]]);
			}
		}
	}
	// ans = sub(ans, 1);
	cout<<ans;
}


Measured memory_bytes: 125156