#include<vector>
#include<set>
#include<map>
#include<queue>
#include<string>
#include<algorithm>
#include<iostream>
#include<bitset>
#include<functional>
#include<numeric>
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<cassert>
#include<cmath>
#include<random>
#include<ctime>
#include<complex>
using namespace std;
typedef long long LL;
mt19937 gene(233);
typedef complex<double> Complex;
#define fi first
#define se second
#define ins insert
#define pb push_back
inline char GET_CHAR(){
	const int maxn = 131072;
	static char buf[maxn],*p1=buf,*p2=buf;
	return p1==p2&&(p2=(p1=buf)+fread(buf,1,maxn,stdin),p1==p2)?EOF:*p1++;
}
inline int getInt() {
	int res(0);
	char c = getchar();
	while(c < '0') c = getchar();
	while(c >= '0') {
		res = res * 10 + (c - '0');
		c = getchar();
	}
	return res;
}

inline LL fastpo(LL x, LL n, LL mod) {
	LL res(1);
	while(n) {
		if(n & 1) {
			res = res * (LL)x % mod;
		}
		x = x * (LL) x % mod;
		n /= 2;
	}
	return res;
}

inline string itoa(int x, int width = 0) {
  string res;
  if(x == 0) res.push_back('0');
  while(x) {
    res.push_back('0' + x % 10);
    x /= 10;
  }
  while((int)res.size() < width) res.push_back('0');
  reverse(res.begin(), res.end());
  return res;
}
const int _B = 131072;
char buf[_B];
int _bl = 0;
inline void flush() {
	fwrite(buf, 1, _bl, stdout);
	_bl = 0;
}
__inline void _putchar(char c) {
	if(_bl == _B) flush();
	buf[_bl++] = c;
}
inline void print(LL x, char c) {
	static char tmp[20];
	int l = 0;
	if(!x) tmp[l++] = '0';
	else {
		while(x) {
			tmp[l++] = x % 10 + '0';
			x /= 10;
		}
	}
	for(int i = l - 1; i >= 0; i--) _putchar(tmp[i]);
	_putchar(c);
}
const int N = 303;
const int LOG = 20;
const int mod = 998244353;
const int inf = 1e9 + 7;
int n, m;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
bitset<N> f[N][N][N];
int dp[N][N][N];
int a[N], c0[N], c1[N];
__inline void add(int & a, int b) {
	if((a += b) >= mod) a -= mod;
}
int vst[N * 2][N * 2];
int main() {
	string s;
	cin >> s;
//s.clear();
//for(int i = 0; i < 300; i++) s.pb(gene() % 2 + '0');
	n = s.size();
	for(int i = 1; i <= n; i++) {
		a[i] = s[i - 1] - '0';
		c0[i] = c0[i - 1] + (a[i] == 0);
		c1[i] = c1[i - 1] + (a[i] == 1);
	}
	f[0][0][0].set(0);
	for(int i = 0; i <= n; i++) {
		for(int j = 0; j <= c0[i]; j++) {
			for(int k = 0; k <= c1[i]; k++) {
				if(i + 2 <= n) {
					f[i + 2][j][k] |= f[i][j][k] << 1;
					if(!a[i + 2] || !a[i + 1]) {
						f[i + 2][j + 1][k] |= f[i][j][k];		
					}
					if(a[i + 2] || a[i + 1]) {
						f[i + 2][j][k + 1] |= f[i][j][k];
					}
				}
				if(i + 1 <= n) {
					if(i != 0) f[i + 1][j][k] |= f[i][j][k];
					if(a[i + 1] == 0) 
						f[i + 1][j + 1][k] |= f[i][j][k] >> 1;
					else f[i + 1][j][k + 1] |= f[i][j][k] >> 1;
				}
			//	printf("%d %d %d: ", i, j, k);
			//	cout << f[i][j][k] << endl;
			}
		}
	}
	dp[n + 1][0][0] = 1;
	for(int i = n; i >= 1; i--) {
		if(a[i] == 0) {
			for(int j = 0; j <= n; j++) {
				int sum = 0;
				for(int k = 0; k <= n; k++) {
					add(sum, dp[i + 1][j][k]);
					add(dp[i][j][k], sum);
				}
			}
		}else {
			for(int j = 0; j <= n; j++) {
				int sum = 0;
				for(int k = 0; k <= n; k++) {
					add(sum, dp[i + 1][k][j]);
					add(dp[i][k][j], sum);
				}
			}
		}
	}
	int ans = 0;
	for(int i = n + 1; i >= 0; i--) {
		for(int j = 0; j <= n; j++) {
			for(int k = 0; k <= n; k++) {
				if(j) add(dp[i][j][k], dp[i][j - 1][k]);
				if(k) add(dp[i][j][k], dp[i][j][k - 1]);
			//	printf("dp[%d][%d][%d] = %d\n", i, j, k, dp[i][j][k]);
				if(f[i - 1][j][k][0]) {
					if(!vst[c0[n] - c0[i - 1] + j][c1[n] - c1[i - 1] + k]) {
						add(ans, dp[i][j][k]);
						vst[c0[n] - c0[i - 1] + j][c1[n] - c1[i - 1] + k] = 1;
					}
				}
			}
		}
	}
	cout << ans << endl;
}






Measured memory_bytes: 304640