//~ while (clock()<=69*CLOCKS_PER_SEC)
//~ #pragma comment(linker, "/stack:200000000")
#ifndef LOCAL
#pragma GCC optimize("O3")
#endif
//~ #pragma GCC optimize("Ofast")
//~ #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
//~ #pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) ((int)(x).size())
#define st first
#define nd second

using namespace __gnu_pbds;
using namespace std;
 
template <typename T>
using ordered_set =
	tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
 
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
	*this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "
 
#define shandom_ruffle random_shuffle
 
using ll=long long;
using pii=pair<int,int>;
using pll=pair<ll,ll>;
using vi=vector<int>;
using vll=vector<ll>;

const int kMaxN = 330;
const int mod = 998244353;
string s;
int n;

inline void Add(int &a, int b) {
	a += b;
	if (a >= mod) { a -= mod; }
}

bool pref_ok[kMaxN][kMaxN][kMaxN];
int dp[kMaxN][kMaxN][kMaxN];

int main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout << fixed << setprecision(11);
	cerr << fixed << setprecision(6);

	cin >> s;
	n = SZ(s);

	pref_ok[0][0][0] = true;
	for (int len = 0; len <= n; ++len) {
		pref_ok[len][0][0] = true;
		for (int a = 0; a <= len; ++a) {
			for (int b = 0; b <= len; ++b) {
				if (!pref_ok[len][a][b]) { continue; }
				debug() << imie(len) << imie(a) << imie(b) << "ok";
				if (len) {
					pref_ok[len + 1][a][b] = true;
				}
				if (len < n) {
					if (a) {
						const int new_a = a - 1 + (s[len] == '0');
						const int new_b = b + (s[len] == '1');
						pref_ok[len + 1][new_a][new_b] = true;
					}
					if (b) {
						const int new_a = a + (s[len] == '0');
						const int new_b = b - 1 + (s[len] == '1');
						pref_ok[len + 1][new_a][new_b] = true;
					}
					if (len < n - 1) {
						pref_ok[len + 2][a + (s[len] == '0')][b + (s[len] == '1')] = true;
						pref_ok[len + 2][a + (s[len+1] == '0')][b + (s[len+1] == '1')] = true;
					}
				}
			}
		}
	}
	pref_ok[n][0][0] = false;

	int ans = 0;

	dp[0][0][0] = 1;
	for (int suf = 0; suf <= n; ++suf) {
		for (int add0 = 0; suf + add0 <= n; ++add0) {
			for (int add1 = 0; suf + add0 + add1 <= n; ++add1) {
				if (!dp[suf][add0][add1]) { continue; }
				debug() << imie(suf) << imie(add0) << imie(add1) << dp[suf][add0][add1] <<
				  " " << pref_ok[n - suf][add0][add1];
				if (pref_ok[n - suf][add0][add1]) {
					Add(ans, dp[suf][add0][add1]);
				}

				char ch = -1;
				if (suf < n) {
					ch = s[n - suf - 1];
				}

				// add 0
				if (ch == '0') {
					Add(dp[suf + 1][add0][add1], dp[suf][add0][add1]);
				} else {
					Add(dp[suf][add0 + 1][add1], dp[suf][add0][add1]);
				}

				// add 1
				if (ch == '1') {
					Add(dp[suf + 1][add0][add1], dp[suf][add0][add1]);
				} else {
					Add(dp[suf][add0][add1 + 1], dp[suf][add0][add1]);
				}
			}
		}
	}

	cout << ans << "\n";
}


Measured memory_bytes: 71912