// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;



template <int MOD_> struct modnum {

	static constexpr int MOD = MOD_;

	static_assert(MOD_ > 0, "MOD must be positive");



private:

	using ll = long long;



	int v;



	static int minv(int a, int m) {

		a %= m;

		assert(a);

		return a == 1 ? 1 : int(m - ll(minv(m, a)) * ll(m) / a);

	}



public:



	modnum() : v(0) {}

	modnum(ll v_) : v(int(v_ % MOD)) { if (v < 0) v += MOD; }

	explicit operator int() const { return v; }

	friend std::ostream& operator << (std::ostream& out, const modnum& n) { return out << int(n); }

	friend std::istream& operator >> (std::istream& in, modnum& n) { ll v_; in >> v_; n = modnum(v_); return in; }



	friend bool operator == (const modnum& a, const modnum& b) { return a.v == b.v; }

	friend bool operator != (const modnum& a, const modnum& b) { return a.v != b.v; }



	modnum inv() const {

		modnum res;

		res.v = minv(v, MOD);

		return res;

	}

	friend modnum inv(const modnum& m) { return m.inv(); }

	modnum neg() const {

		modnum res;

		res.v = v ? MOD-v : 0;

		return res;

	}

	friend modnum neg(const modnum& m) { return m.neg(); }



	modnum operator- () const {

		return neg();

	}

	modnum operator+ () const {

		return modnum(*this);

	}



	modnum& operator ++ () {

		v ++;

		if (v == MOD) v = 0;

		return *this;

	}

	modnum& operator -- () {

		if (v == 0) v = MOD;

		v --;

		return *this;

	}

	modnum& operator += (const modnum& o) {

		v += o.v;

		if (v >= MOD) v -= MOD;

		return *this;

	}

	modnum& operator -= (const modnum& o) {

		v -= o.v;

		if (v < 0) v += MOD;

		return *this;

	}

	modnum& operator *= (const modnum& o) {

		v = int(ll(v) * ll(o.v) % MOD);

		return *this;

	}

	modnum& operator /= (const modnum& o) {

		return *this *= o.inv();

	}



	friend modnum operator ++ (modnum& a, int) { modnum r = a; ++a; return r; }

	friend modnum operator -- (modnum& a, int) { modnum r = a; --a; return r; }

	friend modnum operator + (const modnum& a, const modnum& b) { return modnum(a) += b; }

	friend modnum operator - (const modnum& a, const modnum& b) { return modnum(a) -= b; }

	friend modnum operator * (const modnum& a, const modnum& b) { return modnum(a) *= b; }

	friend modnum operator / (const modnum& a, const modnum& b) { return modnum(a) /= b; }

};



using num = modnum<998244353>;



template <typename T> void set_min(T& a, T b) {

	if (b < a) a = b;

}



const int INF = 1e8;

const int M = 305;

string s;

int pref[M][M];

bool ok[3][M][M];



num dp[M][M], newdp[M][M];



int main() {

	ios::sync_with_stdio(0), cin.tie(0);

	cin >> s;

	int n = int(s.size());

	// pref[i][j]

	{

		for (int i = 0; i <= n; i++) {

			for (int j = 0; j <= n; j++) {

				pref[i][j] = INF;

			}

		}

		pref[0][0] = 0;

		int c0 = 0, c1 = 1, c2 = 2;

		ok[c0][0][0] = true;

		for (int k = 0; k < n; k++) {

			for (int i = 0; i <= n; i++) {

				for (int j = 0; j <= n; j++) {

					if (!ok[c0][i][j]) continue;

					if (i && s[k] == '1') {

						ok[c1][i-1][j+1] = true;

					}

					if (i && s[k] == '0') {

						ok[c1][i][j] = true;

					}

					if (j && s[k] == '0') {

						ok[c1][i+1][j-1] = true;

					}

					if (j && s[k] == '1') {

						ok[c1][i][j] = true;

					}

					if (k+1 < n) {

						for (int z = 0; z < 2; z++) {

							if (s[k]-'0' == z || s[k+1]-'0' == z) {

								ok[c2][i+(z==0)][j+(z==1)] = true;

							}

						}

					}

				}

			}

			c0 = (c0+1) % 3;

			c1 = (c1+1) % 3;

			c2 = (c2+1) % 3;

			for (int i = 0; i <= n; i++) {

				for (int j = 0; j <= n; j++) {

					if (ok[c0][i][j] && pref[i][j] == INF) {

						pref[i][j] = k+1;

					}

				}

			}

		}

	}



	num total = 0;

	reverse(s.begin(), s.end());

	dp[0][0] = 1;

	for (int k = 0; k < n; k++) {

		for (int i = 0; i <= k+1; i++) {

			for (int j = 0; i+j <= k+1; j++) {

				newdp[i][j] = 0;

			}

		}

		for (int i = 0; i <= k; i++) {

			for (int j = 0; i+j <= k; j++) {

				int z = s[k-i-j]-'0';

				newdp[i][j] += dp[i][j];

				if (z == 0) {

					newdp[i][j+1] += dp[i][j];

				} else if (z == 1) {

					newdp[i+1][j] += dp[i][j];

				} else assert(false);

			}

		}

		for (int i = 0; i <= k+1; i++) {

			for (int j = 0; i+j <= k+1; j++) {

				dp[i][j] = newdp[i][j];

			}

		}

		for (int i = 0; i <= k+1; i++) {

			for (int j = 0; i+j <= k+1; j++) {

				int rest = k+1 - (i+j);

				if (pref[i][j] <= n-rest) {

					total += dp[i][j];

				}

			}

		}

	}

	cout << total << '\n';

}


// Faster C++ solution for the same problem (measured speedup: 2.248836581937919x):
#include <bits/stdc++.h>

using namespace std;



typedef unsigned int uint;

typedef unsigned long long ull;

const uint MOD = 998244353;

const ull LMOD = (ull(7e18) / MOD) * MOD;



const int M = 310;

string s;

int n;

int pref[M][M];

bool ok[3][M][M];



uint dp[M][M];



int main() {

	ios::sync_with_stdio(0), cin.tie(0);

	cin >> s;

	n = int(s.size());

	{

		for (int i = 0; i <= n; i++) {

			for (int j = 0; j <= n; j++) {

				pref[i][j] = M;

			}

		}

		pref[0][0] = 0;

		int c0 = 0, c1 = 1, c2 = 2;

		ok[c0][0][0] = true;

		for (int k = 0; k < n; k++) {

			for (int i = 0; i <= k; i++) {

				for (int j = 0; i+j <= k; j++) {

					if (!ok[c0][i][j]) continue;

					// 直接扔掉

					ok[c1][i][j] = true;

					if (i && s[k] == '1') {

						ok[c1][i-1][j+1] = true;

					}

					if (j && s[k] == '0') {

						ok[c1][i+1][j-1] = true;

					}

					if (k+1 < n) {

						for (int zz = 0; zz < 2; zz++) {

							if (zz == s[k]-'0' || zz == s[k+1]-'0') {

								ok[c2][i + (zz==0)][j + (zz==1)] = true;

							}

						}

					}

				}

			}

			c0 = (c0+1) % 3;

			c1 = (c1+1) % 3;

			c2 = (c2+1) % 3;

			for (int i = 0; i <= k+1; i++) {

				for (int j = 0; i+j <= k+1; j++) {

					if (ok[c0][i][j] && pref[i][j] == M) {

						pref[i][j] = k+1;

					}

				}

			}

		}

	}



	ull total = 0;

	reverse(s.begin(), s.end());

	dp[0][0] = 1;

	for (int k = 0; k < n; k++) {

		for (int i = k; i >= 0; i--) {

			for (int j = k-i; j >= 0; j--) {

				if (!dp[i][j]) continue;

				int z = s[k-i-j] - '0';

				if (z == 0) {

					dp[i][j+1] += dp[i][j];

					if (dp[i][j+1] >= MOD) dp[i][j+1] -= MOD;

				} else {

					dp[i+1][j] += dp[i][j];

					if (dp[i+1][j] >= MOD) dp[i+1][j] -= MOD;

				}

			}

		}

		for (int i = 0; i <= k+1; i++) {

			for (int j = 0; i+j <= k+1; j++) {

				int rest = (k+1) - (i+j);

				if (pref[i][j] <= n-rest) {

					total += dp[i][j];

				}

			}

		}

	}

	total %= MOD;

	cout << uint(total) << '\n';

}