#include <algorithm>
#include <bitset>
#include <cassert>
#include <chrono>
#include <climits>
#include <cstdint>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iostream>
#include <iomanip>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <sstream>
#include <tuple>
#include <vector>

using namespace std;
using namespace chrono;

#ifdef DEBUG
	#define LOCAL_INPUT_FILE
#else
	//~ #define USE_FILE_IO
#endif

#ifdef USE_FILE_IO
	#define INPUT_FILE "input.txt"
	#define OUTPUT_FILE "output.txt"
	#define cin ____cin
	#define cout ____cout
	ifstream cin(INPUT_FILE);
	ofstream cout(OUTPUT_FILE);
#else
	#ifdef LOCAL_INPUT_FILE
		#define cin ____cin
		ifstream cin("input.txt");
	#endif
#endif

const int infinity = (int)1e9 + 42;
const int64_t llInfinity = (int64_t)1e18 + 256;
const int module = (int)1e9 + 7; 
const long double eps = 1e-8;

mt19937_64 randGen(system_clock().now().time_since_epoch().count());

inline void raiseError(string errorCode) {
	cerr << "Error : " << errorCode << endl;
	exit(42);
}

signed main() {
	#ifndef USE_FILE_IO
		ios_base::sync_with_stdio(false);
	#endif
	
	const int mod = 998'244'353;
	
	string s; cin >> s;
	int n = s.size();
	
	vector<int> c0(n+1);
	c0[n] = 0;
	for (int i = n-1; i >= 0; --i) {
		c0[i] = c0[i+1] + (s[i] == '0');
	}
	
	static bool ok[303][303][303];
	static int mn[303][303];
	
	ok[n][0][0] = true;
	for (int i = 0; i <= n; ++i) {
		for (int j = 0; j <= n; ++j) {
			mn[i][j] = INT_MAX;
		}
	}
	
	for (int sm = n; sm >= 1; --sm) {
		for (int r = 0; r <= sm; ++r) {
			for (int s0 = 0; r+s0 <= sm; ++s0) {
				int s1 = sm - r - s0;
				if (!ok[r][s0][s1]) continue;
				mn[sm][s0 + c0[n-r]] = min(mn[sm][s0 + c0[n-r]], r);
				// remove two usual
				if (r >= 2) {
					ok[r-2][s0 + (s[n-r] == '0' || s[n-r+1] == '0')][s1] = true;
					ok[r-2][s0][s1 + (s[n-r] == '1' || s[n-r+1] == '1')] = true;
				}
				// remove one usual & one floating
				if (r >= 1 && s0 > 0) {
					ok[r-1][s0][s1] = true;
					ok[r-1][s0 - 1 + (s[n-r] == '0')][s1] = true;
					ok[r-1][s0 - 1][s1 + (s[n-r] == '1')] = true;
				}
				if (r >= 1 && s1 > 0) {
					ok[r-1][s0][s1] = true;
					ok[r-1][s0 + (s[n-r] == '0')][s1 - 1] = true;
					ok[r-1][s0][s1 - 1 + (s[n-r] == '1')] = true;
				}
				// remove two floating
				if (s0+s1 >= 2) {
					if (s0 > 0) {
						ok[r][s0-1][s1] = true;
					}
					if (s1 > 0) {
						ok[r][s0][s1-1] = true;
					}
				}
			}
		}
	}
	
	static int dp[303][303][303] = {};
	dp[n][0][0] = 1;
	for (int i = n; i >= 0; --i) {
		for (int j = 0; j <= n; ++j) {
			for (int k = 0; k <= n; ++k) {
				if (i != 0) {
					dp[i-1][j][k] += dp[i][j][k];
					dp[i-1][j][k] %= mod;
				}
				if (i == 0 || s[i-1] == '0') {
					dp[i][j][k+1] += dp[i][j][k];
					dp[i][j][k+1] %= mod;
				}
				if (i == 0 || s[i-1] == '1') {
					dp[i][j+1][k] += dp[i][j][k];
					dp[i][j+1][k] %= mod;
				}
			}
		}
	}
	
	int ans = 0;
	for (int sz = 1; sz <= n; ++sz) {
		for (int z = 0; z <= sz; ++z) {
			int r = mn[sz][z];
			if (r == INT_MAX) {
				continue;
			}
			int s0 = z - c0[n-r];
			int s1 = sz - r - s0;
			int p = n-r;
			while (p >= 0 && s0 >= 0 && s1 >= 0) {
				ans += dp[p][s0][s1];
				ans %= mod;
				if (p == 0) {
					break;
				}
				--p;
				--(s[p] == '0' ? s0 : s1);
			}
		}
	}
	cout << ans << endl;
	
	return 0;
}


Measured memory_bytes: 119684