#include <bits/stdc++.h>

const int N = 310;
const int moder = 998244353;
const int INF = 0x3f3f'3f3f;

char s[N];
bool dp[N][N][N];
int dp1[N][N][N];
int comb[N][N];
int suf[N];
int pre[N][N][N];
int min[N][N];

void add(int &a, int b){
    a += b, a -= a >= moder ? moder : 0;
}

int main(){
    for (int i = 0; i < N; ++ i){
        comb[i][0] = 1;
        for (int j = 1; j <= i; ++ j){
            comb[i][j] = (comb[i - 1][j - 1] + comb[i - 1][j]) % moder;
        }
    }
    scanf("%s", s);
    int n = strlen(s);
    dp[n][0][0] = true;
    for (int i = n; i >= 2; -- i){
        for (int j = 0; j < N; ++ j){
            for (int k = 0; k < N; ++ k){
                if (!dp[i][j][k]){
                    continue;
                }
                int len = i - j - k;
                int front = s[n - len] - '0';
                int s_front = s[n - len + 1] - '0';
                if (j >= 2){
                    dp[i - 1][j - 1][k] = true;
                }
                if (j >= 1 && k >= 1){
                    dp[i - 1][j - 1][k] = true;
                    dp[i - 1][j][k - 1] = true;
                }
                if (k >= 2){
                    dp[i - 1][j][k - 1] = true;
                }
                if (len >= 1){
                    if (j >= 1){
                        dp[i - 1][j][k] = true;
                        dp[i - 1][j - 1 + (front == 0)][k + (front == 1)] = true;
                    }
                    if (k >= 1){
                        dp[i - 1][j][k] = true;
                        dp[i - 1][j + (front == 0)][k - 1 + (front == 1)] = true;
                    }
                }
                if (len >= 2){
                    dp[i - 1][j + (front == 0)][k + (front == 1)] = true;
                    dp[i - 1][j + (s_front == 0)][k + (s_front == 1)] = true;
                }
            }
        }
    }
    dp1[0][0][0] = 1;
    for (int i = 0; i <= n; ++ i){
        for (int j = 0; j <= n; ++ j){
            for (int k = 0; k <= n; ++ k){
                if (dp1[i][j][k] == 0){
                    continue;
                }
                if (k < n && s[n - 1 - k] == '0'){
                    add(dp1[i + 1][j][k + 1], dp1[i][j][k]);
                }
                else{
                    add(dp1[i + 1][j][k], dp1[i][j][k]);
                }
                if (k < n && s[n - 1 - k] == '1'){
                    add(dp1[i][j + 1][k + 1], dp1[i][j][k]);
                }
                else{
                    add(dp1[i][j + 1][k], dp1[i][j][k]);
                }
            }
        }
    }
    for (int i = n - 1; i >= 0; -- i){
        suf[i] = suf[i + 1] + (s[i] == '0');
    }
    for (int i = 0; i < N; ++ i){
        for (int j = 0; j < N; ++ j){
            for (int k = n; k >= 0; -- k){
                pre[i][j][k] = pre[i][j][k + 1];
                add(pre[i][j][k], dp1[i][j][k]);
            }
        }
    }
    memset(min, 0x3f, sizeof(min));
    for (int i = n; i >= 1; -- i){
        for (int j = 0; j < N; ++ j){
            for (int k = 0; k < N; ++ k){
                if (dp[i][j][k]){
                    int len = i - j - k;
                    int zero = j + suf[n - len];
                    int one = k + len - suf[n - len];
                    min[zero][one] = std::min(min[zero][one], len);
                }
            }
        }
    }
    int ans = 0;
    for (int i = 0; i < N; ++ i){
        for (int j = 0; j < N; ++ j){
            if (min[i][j] == INF){
                continue;
            }
            add(ans, pre[i][j][min[i][j]]);
        }
    }
    printf("%d\n", ans);
    return 0;
}

Measured memory_bytes: 240428