#include <bits/stdc++.h>
#define F first
#define S second
#define mp make_pair
#define pb push_back
//#define ll __int128
#define ll long long
#define int long long
//#define int __int128
#define LEFT(a) ((a)<<1)
#define RIGHT(a) (LEFT(a) + 1)
#define MID(a,b) ((a+b)>>1)
#define MAX(a,b) ((a)>(b)?(a):(b))
#define MIN(a,b) ((a)<(b)?(a):(b))
#define y1 y122

/*
#pragma GCC optimize ("O3")
#pragma GCC optimize("Ofast")

#pragma GCC target("avx2,fma")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC target ("avx2")
#pragma GCC optimization ("unroll-loops")

#pragma comment(linker, "/STACK: 20000000005")
*/

using namespace std;

const int N = 305, MOD = 998244353;

int n;
string S;
int ans;
int dp[N][N][N];
bool D[N][N][N];

bool mas[N][N];
bool mass[N][N];

main()
{
    //freopen ("in.in", "r", stdin);freopen ("out.out", "w", stdout);
    ios_base::sync_with_stdio(0);
    cin >> S;
    n = S.size();
    reverse(S.begin(), S.end());
    S = "#" + S + "##";
    dp[0][0][0] = 1;
    for (int i = 0; i <= n; i++){
        dp[0][0][i] = 1;
        dp[0][i][0] = 1;
    }
    for (int i = 1; i <= n; i++)
        for (int j = 1; j <= n; j++)
            dp[0][i][j] = (dp[0][i-1][j] + dp[0][i][j-1]) % MOD;
    for (int I = 1; I <= n; I++){
        for (int i = 0; i <= n; i++)
            for (int j = 0; j <= n; j++){
                dp[I][i][j] = dp[I-1][i][j];
                if (S[I] == '0'){
                    if (j)
                        dp[I][i][j] += dp[I][i][j-1];
                }
                else {
                    if (i)
                        dp[I][i][j] += dp[I][i-1][j];
                }
                dp[I][i][j] %= MOD;
            }
    }
    D[n+1][0][0] = 1;
    for (int I = n-1; I >= 0; I--){
        int m = n-I;
        for (int x = 0; x <= m; x++)
            for (int y = 0; x+y <= m; y++)
                if (D[I+1][x][y]){
                    if (x+y == 0)
                        continue;
                    D[I][x][y] = 1;
                    if (S[I] == '0'){
                        if (y)
                            D[I][x+1][y-1] = 1;
                    }
                    else {
                        if (x)
                            D[I][x-1][y+1] = 1;
                    }
                }
        for (int x = 0; x <= m; x++)
            for (int y = 0; x+y <= m; y++)
                if (D[I+2][x][y]){
                    if (S[I] == '0' || S[I+1] == '0')
                        D[I][x+1][y] = 1;
                    if (S[I] == '1' || S[I+1] == '1')
                        D[I][x][y+1] = 1;
                }
        for (int x = m; x >= 0; x--)
            for (int y = m-x; y >= 0; y--){
                if (D[I][x][y] == 0 || x+y==1)
                    continue;
                if (x)
                    D[I][x-1][y] = 1;
                if (y)
                    D[I][x][y-1] = 1;
            }
    }
    for (int I = 1; I <= n+1; I++){
        int m = n-I;
        for (int i = 0; i <= n; i++)
            for (int j = 0; j <= n; j++){
                if (mas[i][j]){
                    D[I][i][j] = 0;
                }
                if (D[I][i][j])
                    mas[i][j] = 1;
            }
        int x = 0, y = 0;
        if (S[I] == '0')
            x++;
        else
            y++;
        for (int i = x; i <= n; i++)
            for (int j = y; j <= n; j++)
                if (mas[i][j])
                    mass[i-x][j-y] = 1;
        for (int i = 0; i <= n; i++)
            for (int j = 0; j <= n; j++){
                mas[i][j] = mass[i][j];
                mass[i][j] = 0;
            }
    }
    for (int I = 0; I <= n; I++)
        for (int x = 0; x <= n; x++)
            for (int y = 0; y <= n; y++)
                if (D[I+1][x][y]){
                    ans += dp[I][x][y];
                    //cout << I << " " << x << " " << y << " " << dp[I][x][y] << endl;
                }
    cout << ans%MOD << endl;
}


Measured memory_bytes: 228796