//#pragma GCC optimize("O3")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define trav(x,a) for (const auto& x: a)
#define sz(x) (int)(x).size()
#define all(x) (x).begin(), x.end()
#define mem(a,v) memset((a), (v), sizeof (a))
#define enl printf("\n")
#define case(t) printf("Case #%d: ", (t))
#define ni(n) scanf("%d", &(n))
#define nl(n) scanf("%lld", &(n))
#define nai(a, n) for (int _i = 0; _i < (n); _i++) ni(a[_i])
#define nal(a, n) for (int _i = 0; _i < (n); _i++) nl(a[_i])
#define pri(n) printf("%d\n", (n))
#define prl(n) printf("%lld\n", (n))
#define pii pair<int, int>
#define pll pair<long long, long long>
#define vii vector<pii>
#define vll vector<pll>
#define vi vector<int>
#define vl vector<long long>
#define pb push_back
#define mp make_pair
#define st first
#define nd second
using namespace std;
using namespace __gnu_pbds;
typedef long long ll;
typedef cc_hash_table<int,int,hash<int>> ht;
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> oset;
const double pi = acos(-1);
const int mod = 998244353 ;
const int inf = 1e9 + 7;
const int N = 3e2 + 5;
const double eps = 1e-9;
int vis[N][N][N], C[N][N], lst[N][N];
string s;

int add(int x, int y) { return x+y < mod ? x+y : x+y-mod; }
int sub(int x, int y) { return x-y < 0 ? x-y+mod : x-y; }
int mul(int x, int y) { return x * 1ll * y % mod; }

void dfs(int i, int j, int k) {
  if (min({i,j,k}) < 0 || vis[i][j][k])
    return;
  vis[i][j][k] = 1;
  if (k == 0)
    return;
  if (i+j) {
    dfs(i-1, j, k-1);
    dfs(i, j-1, k-1);
  }
  if (s[sz(s)-k] == '0') {
    dfs(i+1, j, k-2); // XY. -> Y.
    dfs(i, j, k-1);
    dfs(i+1, j-1, k-1);
  }
  if (s[sz(s)-k] == '1') {
    dfs(i, j+1, k-2); // XY. -> Y.
    dfs(i-1, j+1, k-1);
    dfs(i, j, k-1);
  }
  if (k > 1 && s[sz(s)-k+1] == '0') // XY. -> .X <-> .
    dfs(i+1, j, k-2);
  if (k > 1 && s[sz(s)-k+1] == '1') // XY. -> .X <-> .
    dfs(i, j+1, k-2);
}

int calc(int i, int j, int a, int b) {
  // int r = 0;
  // for (int msk = 0; msk < (1 << (i+j+a+b)); msk++) {
  //   if (__builtin_popcount(msk) != j+b)
  //     continue;
  //   int l1 = 0, r1 = 0, cl = -1, cr = i+j+a+b;
  //   for (int it = 0; it < i+j+a+b && l1 < a; it++)
  //     if (!(msk & (1 << it))) {
  //       l1++;
  //       cl = it;
  //     }
  //   for (int it = i+j+a+b-1; it >= 0 && r1 < b; it--)
  //     if ((msk & (1 << it))) {
  //       r1++;
  //       cr = it;
  //     }
  //   assert(l1 == a);
  //   assert(r1 == b);
  //   r += cl <= cr;
  //   // if (i == 0 && j == 1 && a == 0 && b == 0)
  //   //   cerr << msk << endl;
  // }
  int r2 = 0;
  if (a == 0)
    r2 = C[a+i+b+j][a+i];
  else for (int k = a; k <= a+j; k++)
    r2 = add(r2, mul(C[k-1][a-1], C[a+i+b+j-k][i]));
  // if (r != r2)
    // printf("ins %dx0, %dx1 into a suffix of length %d+%d: %d\n", i, j, a, b, r2);
  return r2;
}

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  C[0][0] = 1;
  for (int i = 1; i < N; C[i++][0] = 1)
    for (int j = 1; j <= i; j++)
      C[i][j] = add(C[i-1][j], C[i-1][j-1]);
  cin >> s;
  int n = sz(s);
  dfs(0, 0, n);
  int ans = 0;
  memset(lst, -1, sizeof lst);
  auto upd = [&](int& x, int y) {
    if (x == -1 || y < x)
      x = y;
  };
  for (int i = 0; i <= n; i++) {
    for (int j = 0; j <= n; j++) {
      int cnt[2] = {0,0};
      for (int k = 0; k <= n; k++) {
        if (k) cnt[s[n-k]-'0']++;
        if (vis[i][j][k]) {
          upd(lst[i+cnt[0]][j+cnt[1]], k);
        }
      }
    }
  }
  for (int i = 0; i <= n; i++) {
    for (int j = 0; j <= n; j++) {
      int cnt[2] = {0,0};
      int ok = 0, l = 0;
      for (int k = n; k >= 0; k--) {
        if (vis[i][j][k]) {
          ok = 1;
          l = k;
          break;
        }
      }
      if (!ok) continue;
      for (int k = 0; k <= n; k++) {
        if (k) cnt[s[n-k]-'0']++;
        if (!vis[i][j][k] || k != lst[i+cnt[0]][j+cnt[1]])
          continue;
        // if (k != l)
        //   continue;
        // ins ix0, jx1 into a suffix of length k
        ans = add(ans, calc(i, j, cnt[0], cnt[1]));
        // break;
      }
    }
  }
  ans = sub(ans, 1);
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 18312