#include <bits/stdc++.h>

const int MOD = 998244353;
inline void Add(int &x, int y) { (x += y) >= MOD && (x -= MOD); }

int n;
char s[310];
int dp[310][310][310];
// dp[pos][cnt0][cnt1]
bool can[310][310][310];
// can[pos][cnt0][cnt1]

int main() {
	scanf(" %s", s + 1), n = strlen(s + 1);
	dp[n + 1][0][0] = 1;
	for (int i = n + 1; i; --i)
		for (int j = 0; j <= n; ++j)
			for (int k = 0; k <= n; ++k) {
				Add(dp[i - 1][j][k], dp[i][j][k]);
				int c = s[i - 1] & 15;
				if (!c) Add(dp[i][j][k + 1], dp[i][j][k]);
				else Add(dp[i][j + 1][k], dp[i][j][k]);
			}
	can[0][0][0] = true;
	for (int i = 0; i <= n; ++i)
		for (int j = n; ~j; --j)
			for (int k = n; ~k; --k) if (can[i][j][k]) {
				if (j) can[i][j - 1][k] = true;
				if (k) can[i][j][k - 1] = true;
				can[i + 1][j][k] = true;
				if (i < n && s[i + 1] == '0' && k) can[i + 1][j + 1][k - 1] = true;
				if (i < n && s[i + 1] == '1' && j) can[i + 1][j - 1][k + 1] = true;
				if (i < n - 1 && (s[i + 1] == '0' || s[i + 2] == '0')) can[i + 2][j + 1][k] = true;
				if (i < n - 1 && (s[i + 1] == '1' || s[i + 2] == '1')) can[i + 2][j][k + 1] = true;
			}
	int ans = 0;
	for (int i = 1; i <= n; ++i)
		for (int j = 0; j <= n; ++j)
			for (int k = 0; k <= n; ++k) if (can[i][j][k]) Add(ans, dp[i + 1][j][k]);
	printf("%d\n", ans);
	return 0;
}